This commit is contained in:
caiwx86 2023-04-06 16:18:01 +08:00
parent ec63ffd1de
commit 3c74f84ca4
2 changed files with 9 additions and 2 deletions

View File

@ -102,12 +102,19 @@ class ComicInfo:
@classmethod
def writeComicInfoXML(cls,overlay=False):
save_path = ComicPath.getPathComicInfoXML()
if os.path.exists(save_path):
if overlay:
os.remove(save_path)
logging.info(f"已存在文件,已删除... {save_path}")
else:
logging.info(f"已存在文件,跳过中... {save_path}")
return True
cls.initComicInfoXML()
root = cls.root_node("ComicInfo")
new_document = Document()
new_document.appendChild(root)
cls.add_nodes(root,ComicInfoEntity.getNodes())
save_path = ComicPath.getPathComicInfoXML()
with open(save_path, "w", encoding="utf-8") as fo:
new_document.writexml(fo, indent='', addindent='\t', newl='\n', encoding="utf-8")
fo.close()

View File

@ -226,7 +226,7 @@ class fileUtils:
img = Image.open(file_path)
img.verify()
img.close()
logger.debug(f"{file_path} 类型为type:{type} size: {file_size_unit}")
logger.info(f"{file_path} 类型为type:{type} size: {file_size_unit}")
return True
except:
if os.path.exists(file_path):