mirror of
https://github.com/FutaGuard/LowTechFilter.git
synced 2025-06-21 05:21:02 +08:00
refactor: only write files when not empty
This commit is contained in:
parent
9737fbec32
commit
16d814ed7e
@ -39,12 +39,13 @@ def main():
|
||||
domain = urlparse('http://'+row['WEBURL']).hostname
|
||||
if domain not in current_domains:
|
||||
added_list.append(domain)
|
||||
|
||||
with open(filename, 'a+') as f:
|
||||
f.write('\n')
|
||||
f.write(
|
||||
'\n'.join(e for e in added_list)
|
||||
)
|
||||
|
||||
if added_list:
|
||||
with open(filename, 'a+') as f:
|
||||
f.write('\n')
|
||||
f.write(
|
||||
'\n'.join(e for e in added_list)
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
x
Reference in New Issue
Block a user