mirror of
https://github.com/PurpleI2P/i2pd-tools.git
synced 2025-01-22 21:37:18 +01:00
update
This commit is contained in:
parent
e548512f1e
commit
08779e3f89
|
@ -22,7 +22,7 @@ def main():
|
|||
p = processor.BaddieProcessor([f])
|
||||
netdb.inspect(p.hook)
|
||||
with open(s.get("output", "file", fallback="baddies.txt"), 'w') as f:
|
||||
p.write_blocklist(f)
|
||||
print ('wrote {} blocklist entries'.format(p.write_blocklist(f)))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -21,6 +21,9 @@ class BaddieProcessor:
|
|||
self._baddies[addr] = reason
|
||||
|
||||
def write_blocklist(self, f):
|
||||
wrote = 0
|
||||
f.write('# baddies blocklist generated on {}\n'.format(datetime.datetime.now()))
|
||||
for k in self._baddies:
|
||||
f.write('{}:{}\n'.format(self._baddies[k], k))
|
||||
wrote += 1
|
||||
return wrote
|
||||
|
|
Loading…
Reference in a new issue