Browse Source

py-i2phosts-fetcher: add command-line options support

pull/1/head
Hidden Z 14 years ago
parent
commit
dd46733afd
  1. 10
      py-i2phosts-fetcher

10
py-i2phosts-fetcher

@ -8,6 +8,7 @@ import errno
import time import time
import urllib2 import urllib2
import subprocess import subprocess
import argparse
proxyurl = 'http://localhost:4444/' proxyurl = 'http://localhost:4444/'
sources = ['http://www.i2p2.i2p/hosts.txt', 'http://stats.i2p/cgi-bin/newhosts.txt', sources = ['http://www.i2p2.i2p/hosts.txt', 'http://stats.i2p/cgi-bin/newhosts.txt',
@ -18,6 +19,15 @@ sources = ['http://www.i2p2.i2p/hosts.txt', 'http://stats.i2p/cgi-bin/newhosts.t
#sources = ['http://www.i2p2.i2p/hosts.txt', 'http://stats.i2p/cgi-bin/newhosts.txt'] #sources = ['http://www.i2p2.i2p/hosts.txt', 'http://stats.i2p/cgi-bin/newhosts.txt']
#sources = ['http://hiddenchan.i2p/ggfg.txt'] #sources = ['http://hiddenchan.i2p/ggfg.txt']
#sources = ['http://stats.i2p/cgi-bin/newhosts.xml'] #sources = ['http://stats.i2p/cgi-bin/newhosts.xml']
# parse command line options
parser = argparse.ArgumentParser(
description='Hosts fetcher for py-i2phosts.',
epilog='Report bugs to http://zzz.i2p/topics/733')
parser.add_argument('-d', '--debug', action='store_true',
help='write debug messages to stdout instead of log file'),
parser.add_argument('-c', '--config', default='/etc/py-i2phosts/fetcher.conf', dest='config_file',
help='config file to use')
args = parser.parse_args()
# we want open urls through proxy # we want open urls through proxy
proxy_handler = urllib2.ProxyHandler({'http': proxyurl}) proxy_handler = urllib2.ProxyHandler({'http': proxyurl})

Loading…
Cancel
Save