Too Much Space . So i reduce
This commit is contained in:
parent
91b6e70887
commit
c8696504c9
23
excluder.py
23
excluder.py
@ -26,4 +26,25 @@ def add_file(incoming,excluded_in):
|
||||
with open(incoming, 'w') as f:
|
||||
f.writelines(set(lines))
|
||||
crawler.sort(incoming)
|
||||
os.remove(excluded_in)
|
||||
os.remove(excluded_in)
|
||||
|
||||
def remove(incoming,input):
|
||||
with open(incoming, 'r') as f:
|
||||
lines = f.read().split()
|
||||
with open(incoming, 'w') as f:
|
||||
for line in lines:
|
||||
if line.startswith(input) and input in line:
|
||||
f.write(line.replace(input ,''))
|
||||
elif not line.startswith(input):
|
||||
f.write('\n'.join([line + '\n']))
|
||||
with open(incoming ,'r') as f:
|
||||
lines = f.read().split()
|
||||
with open(incoming ,'w') as f:
|
||||
for line in lines:
|
||||
if line.strip():
|
||||
f.write('\n'.join([line + '\n']))
|
||||
with open(incoming, 'r') as f:
|
||||
lines = set(f.readlines())
|
||||
with open(incoming, 'w') as f:
|
||||
f.writelines(set(lines))
|
||||
crawler.sort(incoming)
|
@ -37,7 +37,7 @@ def hostsbuilding(excluded ,incoming ,output):
|
||||
f.write('ff02::1 ip6-allnodes\n')
|
||||
f.write('ff02::2 ip6-allrouters\n')
|
||||
f.write('ff02::3 ip6-allhosts\n')
|
||||
f.write('0.0.0.0 0.0.0.0\n\n\n')
|
||||
f.write('0.0.0.0 0.0.0.0\n\n')
|
||||
|
||||
for line in lines:
|
||||
if line.strip() and not line in exclude and not line.startswith('#'):
|
||||
|
Loading…
Reference in New Issue
Block a user