mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-02-08 12:54:23 +00:00
injector: ignore comments and empty lines
This commit is contained in:
parent
d7dce40818
commit
5e8b354f9f
3
injector
3
injector
@ -24,6 +24,9 @@ args = parser.parse_args()
|
|||||||
|
|
||||||
f = open(args.hostsfile, 'r')
|
f = open(args.hostsfile, 'r')
|
||||||
for line in f:
|
for line in f:
|
||||||
|
# ignore comments and empty lines
|
||||||
|
if line.startswith('#') or line.isspace():
|
||||||
|
continue
|
||||||
if line.find('=') == -1:
|
if line.find('=') == -1:
|
||||||
print 'Invalid line: %s' % line
|
print 'Invalid line: %s' % line
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user