mirror of
https://github.com/minoplhy/filters-maker.git
synced 2024-12-22 18:18:13 +00:00
Fix Duplicated line operation on same file but diffrent as cause file error
This commit is contained in:
parent
7fb29f89ff
commit
c00d97346f
12
excluder.py
12
excluder.py
@ -20,18 +20,19 @@ def add_file(incoming,excluded_in):
|
||||
with open(excluded_in) as fp:
|
||||
data2 = fp.read()
|
||||
data += data2
|
||||
with open (incoming, 'w') as fp:
|
||||
with open(incoming, 'w') as fp:
|
||||
fp.write(data + '\n')
|
||||
with open(incoming ,'r') as f:
|
||||
fp.close()
|
||||
with open(incoming, 'r') as f:
|
||||
lines = f.read().split()
|
||||
with open(incoming ,'w') as f:
|
||||
with open(incoming, 'w') as f:
|
||||
for line in lines:
|
||||
if line.strip() and not line.startswith((tuple(comment_roc))):
|
||||
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))
|
||||
f.writelines(set(lines))
|
||||
crawler.sort(incoming)
|
||||
os.remove(excluded_in)
|
||||
|
||||
@ -53,7 +54,8 @@ def remove(incoming,userinput):
|
||||
with open(incoming, 'r') as f:
|
||||
lines = set(f.readlines())
|
||||
with open(incoming, 'w') as f:
|
||||
f.writelines(set(lines))
|
||||
f.writelines(set(lines))
|
||||
f.close()
|
||||
crawler.sort(incoming)
|
||||
|
||||
def remove_file(incoming ,removed_in):
|
||||
|
Loading…
Reference in New Issue
Block a user