def globDir(d): dirs = [ f for f in listdir(d) if isdir(join(d,f)) ] mboxes = [ f for f in glob.glob(join(d,"*" + extension)) if isfile(f) ] if not d in fileToLID and len(mboxes) > 0 and interactive: print("Would you like to set a list-ID override for %s?:" % d) lo = sys.stdin.readline() if lo and len(lo) > 3: fileToLID[d] = archiver.normalize_lid(lo.strip("\r\n")) print("Righto, setting it to %s." % fileToLID[d]) else: print("alright, I'll try to figure it out myself!") for fi in sorted(mboxes): lists.append([fi, fileToLID.get(d) if fileToLID.get(d) else list_override]) for nd in sorted(dirs): globDir(join(d,nd))
def globDir(d): dirs = [ f for f in listdir(d) if isdir(join(d,f)) ] mboxes = [ f for f in glob.glob(join(d,"*" + extension)) if isfile(f) ] lo = list_override if not d in fileToLID and len(mboxes) > 0 and interactive: print("Would you like to set a list-ID override for %s?:" % d) lo = sys.stdin.readline() if lo and len(lo) > 3: fileToLID[d] = archiver.normalize_lid(lo.strip("\r\n")) print("Righto, setting it to %s." % fileToLID[d]) else: print("alright, I'll try to figure it out myself!") for fi in sorted(mboxes): lists.append([fi, fileToLID.get(d) if fileToLID.get(d) else list_override]) for nd in sorted(dirs): globDir(join(d,nd))
help = 'Optional sender filter: Only import emails from this address') args = parser.parse_args() if len(sys.argv) <= 2: parser.print_help() sys.exit(-1) if args.source: source = args.source[0] if args.dir: maildir = args.dir if args.listid: list_override = archiver.normalize_lid(args.listid[0]) if args.project: project = args.project[0] if args.domain: appender = args.domain[0] if args.interactive: interactive = args.interactive if args.quick: quickmode = args.quick if args.private: private = args.private if args.dedup: dedup = args.dedup if args.ext: extension = args.ext[0] if args.html2text:
help = 'Skip Mboxo processing') args = parser.parse_args() if len(sys.argv) <= 2: parser.print_help() sys.exit(-1) if args.source: source = args.source[0] if args.dir: maildir = args.dir if args.listid: list_override = archiver.normalize_lid(args.listid[0]) if args.project: project = args.project[0] if args.domain: appender = args.domain[0] if args.interactive: interactive = args.interactive if args.quick: quickmode = args.quick if args.private: private = args.private if args.dedup: dedup = args.dedup if args.ext: extension = args.ext[0] if args.html2text: