mirror of
https://github.com/adulau/ptr-db.git
synced 2024-12-22 08:45:58 +00:00
Skip missing tuples
This commit is contained in:
parent
d0dd9d700e
commit
bf85437a4b
1 changed files with 9 additions and 4 deletions
|
@ -28,10 +28,15 @@ if args.r:
|
||||||
for x in args.r:
|
for x in args.r:
|
||||||
with open(x, encoding='UTF-8', errors='ignore') as f:
|
with open(x, encoding='UTF-8', errors='ignore') as f:
|
||||||
for l in f:
|
for l in f:
|
||||||
|
try:
|
||||||
(ip, ptr) = l.rstrip().split(',')[:2]
|
(ip, ptr) = l.rstrip().split(',')[:2]
|
||||||
if args.v:
|
if args.v:
|
||||||
print (terms(ptr))
|
print(terms(ptr))
|
||||||
r.set(ip,ptr)
|
r.set(ip,ptr)
|
||||||
|
except ValueError:
|
||||||
|
if args.v:
|
||||||
|
print("PTR tuple missing")
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
argParser.print_help()
|
argParser.print_help()
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
Loading…
Reference in a new issue