def main(argv): inputfile = "" outputfile = "" try: opts, args = getopt.getopt(argv, "u:f:") except getopt.GetoptError as e: print "GetoptError: %s" % (e) sys.exit(2) if len(opts) == 0: print "Please include either a url of a mailman web archive" print "or the path to a file with a linebreak-separated list" print "of such urls." print "" print "For example:" print "" print "python bin/collect_mail.py -u http://mail.scipy.org/pipermail/scipy-dev/" print "" print "or" print "" print "python bin/collect_mail.py -f examples/urls.txt" print "" for opt, arg in opts: if opt == "-u": mailman.collect_from_url(arg) sys.exit() elif opt == "-f": mailman.collect_from_file(arg)
def main(argv): inputfile = '' outputfile = '' try: opts, args = getopt.getopt(argv,"u:f:") except getopt.GetoptError as e: print 'GetoptError: %s' % (e) sys.exit(2) if len(opts) == 0: print 'Please include either a url of a mailman web archive' print 'or the path to a file with a linebreak-separated list' print 'of such urls.' print '' print 'For example:' print '' print 'python bin/collect_mail.py -u http://mail.scipy.org/pipermail/scipy-dev/' print '' print 'or' print '' print 'python bin/collect_mail.py -f examples/urls.txt' print '' for opt, arg in opts: if opt == '-u': mailman.collect_from_url(arg) sys.exit() elif opt == '-f': mailman.collect_from_file(arg)
def main(argv): inputfile = '' outputfile = '' try: opts, args = getopt.getopt(argv, "u:f:") except getopt.GetoptError as e: print 'GetoptError: %s' % (e) sys.exit(2) if len(opts) == 0: print 'Please include either a url of a mailman web archive' print 'or the path to a file with a linebreak-separated list' print 'of such urls.' print '' print 'For example:' print '' print 'python bin/collect_mail.py -u http://mail.scipy.org/pipermail/scipy-dev/' print '' print 'or' print '' print 'python bin/collect_mail.py -f examples/urls.txt' print '' for opt, arg in opts: if opt == '-u': mailman.collect_from_url(arg) sys.exit() elif opt == '-f': mailman.collect_from_file(arg)
def main(args): if args.u: if args.archives: mailman.collect_from_url(args.u, archive_dir=args.archives) else: mailman.collect_from_url(args.u) sys.exit() elif args.f: if args.archives: mailman.collect_from_file(args.f, archive_dir=args.archives) else: mailman.collect_from_file(args.f)
def test_mailman_chain(): url = "http://mail.scipy.org/pipermail/ipython-dev/" mailman.collect_from_url(url) mailman.unzip_archive(url) arx = archive.Archive(url) arx.save("test.csv") arx2 = archive.load("test.csv") assert arx.data.shape == arx.data.shape os.remove("test.csv")
def main(args): notes = None if args.notes: notes = args.notes if args.u: if args.archives: mailman.collect_from_url(args.u, archive_dir=args.archives, notes=notes) else: mailman.collect_from_url(args.u, notes=notes) sys.exit() elif args.f: if args.archives: mailman.collect_from_file(args.f, archive_dir=args.archives, notes=notes) else: mailman.collect_from_file(args.f, notes=notes)
def main(args): if args.u: mailman.collect_from_url(args.u) sys.exit() elif args.f: mailman.collect_from_file(args.f)
import bigbang.mailman as mailman from pprint import pprint as pp ARCHIVE_DIR = "archives" URLS_FILE = "urls.txt" for url in open(URLS_FILE): url = url.rstrip() mailman.collect_from_url(url) mailman.unzip_archive(url)