This commit is contained in:
@ -11,3 +11,11 @@ def remove_file(path):
|
|||||||
os.remove(path)
|
os.remove(path)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def clear_dir():
|
||||||
|
temp_path = os.path.join(os.path.dirname(__file__), 'temp')
|
||||||
|
try:
|
||||||
|
os.rmdir(temp_path)
|
||||||
|
print('temp dir is cleared')
|
||||||
|
except:
|
||||||
|
print('temp clear failed')
|
@ -5,7 +5,7 @@ import os
|
|||||||
from handlers.pixiv.comb import extract_pixiv_info, get_prefix_name_on_entry
|
from handlers.pixiv.comb import extract_pixiv_info, get_prefix_name_on_entry
|
||||||
from handlers.pixiv.Webdav import Webdav
|
from handlers.pixiv.Webdav import Webdav
|
||||||
from handlers.pixiv.request import downloadPic
|
from handlers.pixiv.request import downloadPic
|
||||||
from handlers.pixiv.file import save_file, remove_file
|
from handlers.pixiv.file import save_file, remove_file, clear_dir
|
||||||
|
|
||||||
|
|
||||||
webdav = Webdav({
|
webdav = Webdav({
|
||||||
@ -58,7 +58,7 @@ def pixiv_result_handler(entries):
|
|||||||
for entry in entries:
|
for entry in entries:
|
||||||
if entry['id'] == item['id']:
|
if entry['id'] == item['id']:
|
||||||
failed_entries.append(entry)
|
failed_entries.append(entry)
|
||||||
|
clear_dir()
|
||||||
return (success_entries, failed_entries)
|
return (success_entries, failed_entries)
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user