import configparser import os from whoosh import fields from whoosh import analysis import re def __expandconfig(config): """ add the dirs to the config automatically """ basepath = os.path.expanduser(config.get('common','base')) config.set('common', 'basedir', basepath) for section in ['source', 'target']: for option in config.options(section): opt = config.get(section, option) config.set(section, "%sdir" % option, os.path.join(basepath,opt)) config.set('target', 'filesdir', os.path.join( config.get('target', 'builddir'), config.get('source', 'files'), )) return config URLREGEX = re.compile( r'\s+https?\:\/\/?[a-zA-Z0-9\.\/\?\:@\-_=#]+' r'\.[a-zA-Z0-9\.\/\?\:@\-_=#]*' ) EXIFREXEG = re.compile( r'^(?P[0-9]{4}):(?P[0-9]{2}):(?P[0-9]{2})\s+' r'(?P