def import_xmls(path): output = '/tmp/switching/proc-xml-%s' % uuid1() os.makedirs(output) logger = logging.getLogger('atr') handler = logging.FileHandler(os.path.join(output, 'process.log')) formatter = logging.Formatter('%(asctime)s:%(levelname)s:%(message)s') handler.setFormatter(formatter) logger.addHandler(handler) logging.info('Process dir: {0}'.format(output)) input = tasks.gen_new_files_dir(path) tasks.sort_xmls(input, output) tasks.import_files(output)
def sort(path, out): logger = logging.getLogger('atr') logger.info('Sorting XMLS from {0} to {1}'.format(path, out)) tasks.sort_xmls(path, out)