2021-08-05 14:03:58 +00:00
|
|
|
import os
|
2021-08-03 12:04:59 +00:00
|
|
|
import crawler
|
2021-08-03 11:56:08 +00:00
|
|
|
|
|
|
|
def add(incoming,input):
|
|
|
|
with open(incoming, 'r') as f:
|
|
|
|
lines = f.read().split()
|
|
|
|
with open(incoming, 'a') as f:
|
|
|
|
f.write('\n'.join([input + '\n']))
|
|
|
|
with open(incoming, 'r') as f:
|
|
|
|
lines = set(f.readlines())
|
|
|
|
with open(incoming, 'w') as f:
|
|
|
|
f.writelines(set(lines))
|
2021-08-03 12:04:59 +00:00
|
|
|
crawler.sort(incoming)
|
2021-08-03 11:56:08 +00:00
|
|
|
|
|
|
|
def add_file(incoming,excluded_in):
|
2021-08-07 04:04:44 +00:00
|
|
|
with open(incoming, "wb") as outfile:
|
|
|
|
with open(excluded_in, "rb") as infile:
|
|
|
|
outfile.write(infile.read())
|
2021-08-03 11:56:08 +00:00
|
|
|
with open(incoming, 'r') as f:
|
|
|
|
lines = set(f.readlines())
|
|
|
|
with open(incoming, 'w') as f:
|
|
|
|
f.writelines(set(lines))
|
2021-08-05 14:03:58 +00:00
|
|
|
crawler.sort(incoming)
|
|
|
|
os.remove(excluded_in)
|