Browse Source

py-i2phosts-builder: require "hostsfile" to be defined

"hostsfile" should be defined by passing command-line option "-f" or
using config option
pull/1/head
Hidden Z 14 years ago
parent
commit
e48e67705f
  1. 7
      py-i2phosts-builder

7
py-i2phosts-builder

@ -42,10 +42,13 @@ from web.lib.utils import validate_config @@ -42,10 +42,13 @@ from web.lib.utils import validate_config
validate_config(config)
# result hosts.txt
if 'hostsfile' in config:
hostsfile = config['hostsfile']
if args.file:
hostsfile = args.file
elif config['hostsfile'] != None:
hostsfile = config['hostsfile']
else:
sys.stderr.write('Please specify "-f" or define "hostsfile" in config\n')
sys.exit(1)
f = open(hostsfile, 'w')
# get activated hosts

Loading…
Cancel
Save