mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-02-09 13:24:22 +00:00
py-i2phosts-injector: replace sys.stderr with sys.stdout where needed
Writing such kind of messages to stderr was a mistake.
This commit is contained in:
parent
1e4933624a
commit
4755c0d35b
@ -59,7 +59,7 @@ for line in f:
|
|||||||
if line.startswith('#') or line.isspace():
|
if line.startswith('#') or line.isspace():
|
||||||
continue
|
continue
|
||||||
if line.find('=') == -1:
|
if line.find('=') == -1:
|
||||||
sys.stderr.write('Invalid line: %s\n' % line)
|
sys.stdout.write('Invalid line: %s\n' % line)
|
||||||
continue
|
continue
|
||||||
# strip trailing '\n'
|
# strip trailing '\n'
|
||||||
line = line.rstrip('\n')
|
line = line.rstrip('\n')
|
||||||
@ -68,7 +68,7 @@ for line in f:
|
|||||||
hostname = validate_hostname(entry[0])
|
hostname = validate_hostname(entry[0])
|
||||||
base64 = validate_b64hash(entry[1], check_uniq=False) # don't require uniqueness
|
base64 = validate_b64hash(entry[1], check_uniq=False) # don't require uniqueness
|
||||||
except ValidationError, e:
|
except ValidationError, e:
|
||||||
sys.stderr.write('validation error: %s: %s\n\n' % (e, line))
|
sys.stdout.write('validation error: %s: %s\n\n' % (e, line))
|
||||||
else:
|
else:
|
||||||
# Check for already existed hosts in database to avoid unneeded INSERTs
|
# Check for already existed hosts in database to avoid unneeded INSERTs
|
||||||
# beacuse they will fail anyway.
|
# beacuse they will fail anyway.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user