mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-02-02 01:44:40 +00:00
py-i2phosts-fetcher: add command-line options support
This commit is contained in:
parent
6c325725b0
commit
dd46733afd
@ -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…
x
Reference in New Issue
Block a user