1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-02-02 01:44:40 +00:00

injector: ignore comments and empty lines

This commit is contained in:
Hidden Z 2010-10-17 18:41:46 +00:00
parent d7dce40818
commit 5e8b354f9f

View File

@ -24,6 +24,9 @@ args = parser.parse_args()
f = open(args.hostsfile, 'r')
for line in f:
# ignore comments and empty lines
if line.startswith('#') or line.isspace():
continue
if line.find('=') == -1:
print 'Invalid line: %s' % line
continue