5 ms·
config.py: backup = [{ 'name': '/media/programming', 'exclude': ['log_files', 'temp_files'], }, { 'name': '/media/documents',
by dnaquin 18y ago
config.py:
backup = [{
'name': '/media/programming',
'exclude': ['log_files', 'temp_files'],
}, {
'name': '/media/documents',
'exclude': ['archive'],
}]
of the top of my head.
*editted for formatting
- pchivers 18y agoYeah, I've done that as well. Are there any security considerations to think about if using that approach?
- dnaquin 18y agowell. it's mutable. your code can change it. don't do it (often). then you're just programming with lots of global state.
- deleted 18y ago[deleted]
- dnaquin 18y agojeff:disqus devin$ wc settings.py settings.xml 1 15 142 settings.py 16 19 461 settings.xml 17 34 603 total 30% of the words. and, in my opinion, just as readable if not more.
- deleted 18y ago[deleted]
- fauigerzigerk 18y agoOr with a little less clutter :-) <backup> <dir name="/media/programming" exclude="log_files temp_files" /> <dir name="/media/documents" exclude="archive" /> </backup>
- snprbob86 18y agoi'd probably define some helper functions to check argument values and such: config = backup( directory('/media/programming', exclude=['log_files', 'temp_files']), directory('/media/documents', exclude='archive') )