comparison MoinMoin/config/multiconfig.py @ 4109:e88baf535b48

fix backup action configuration (broke on windows due to backslashes in e.g. cache_dir), try 2. cfg.backup_exclude is now just a function of filename, telling whether the file should be excluded. By default, no file is excluded.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 19 Sep 2008 21:41:40 +0200
parents 1cd493d5e113
children 62177a952833 4f3d0b92d1c9
comparison
equal deleted inserted replaced
4108:1cd493d5e113 4109:e88baf535b48
322 self._site_plugin_lists = {} 322 self._site_plugin_lists = {}
323 323
324 # we replace any string placeholders with config values 324 # we replace any string placeholders with config values
325 # e.g u'%(page_front_page)s' % self 325 # e.g u'%(page_front_page)s' % self
326 self.navi_bar = [elem % self for elem in self.navi_bar] 326 self.navi_bar = [elem % self for elem in self.navi_bar]
327
328 # compile regex for backup exclusions and cache it
329 self.cache.backup_exclude_regex = re.compile("|".join(self.backup_exclude))
330 327
331 # check if python-xapian is installed 328 # check if python-xapian is installed
332 if self.xapian_search: 329 if self.xapian_search:
333 try: 330 try:
334 import xapian 331 import xapian
1202 'These settings control how the backup action works and who is allowed to use it.', 1199 'These settings control how the backup action works and who is allowed to use it.',
1203 ( 1200 (
1204 ('compression', 'gz', 'What compression to use for the backup ("gz" or "bz2").'), 1201 ('compression', 'gz', 'What compression to use for the backup ("gz" or "bz2").'),
1205 ('users', [], 'List of trusted user names who are allowed to get a backup.'), 1202 ('users', [], 'List of trusted user names who are allowed to get a backup.'),
1206 ('include', [], 'List of pathes to backup.'), 1203 ('include', [], 'List of pathes to backup.'),
1207 ('exclude', 1204 ('exclude', lambda filename: False, 'Function f(filename) that tells whether a file should be excluded from backup. By default, nothing is excluded.'),
1208 [
1209 r"(.+\.py(c|o)$)",
1210 r"%(/)spages%(/)s.+%(/)scache%(/)s[^%(/)s]+$" % {'/': os.sep},
1211 r"%(/)s(edit-lock|event-log|\.DS_Store)$" % {'/': os.sep},
1212 ],
1213 'List of regular expressions matching files that should be excluded from the backup.'),
1214 )), 1205 )),
1215 } 1206 }
1216 1207
1217 def _add_options_to_defconfig(opts, addgroup=True): 1208 def _add_options_to_defconfig(opts, addgroup=True):
1218 for groupname in opts: 1209 for groupname in opts: