import configparser import os import re import glob import logging import subprocess from whoosh import fields from whoosh import analysis 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 ARROWISO = 'YYYY-MM-DDTHH:mm:ssZ' 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