fix
This commit is contained in:
parent
ec63ffd1de
commit
3c74f84ca4
@ -102,12 +102,19 @@ class ComicInfo:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def writeComicInfoXML(cls,overlay=False):
|
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()
|
cls.initComicInfoXML()
|
||||||
root = cls.root_node("ComicInfo")
|
root = cls.root_node("ComicInfo")
|
||||||
new_document = Document()
|
new_document = Document()
|
||||||
new_document.appendChild(root)
|
new_document.appendChild(root)
|
||||||
cls.add_nodes(root,ComicInfoEntity.getNodes())
|
cls.add_nodes(root,ComicInfoEntity.getNodes())
|
||||||
save_path = ComicPath.getPathComicInfoXML()
|
|
||||||
with open(save_path, "w", encoding="utf-8") as fo:
|
with open(save_path, "w", encoding="utf-8") as fo:
|
||||||
new_document.writexml(fo, indent='', addindent='\t', newl='\n', encoding="utf-8")
|
new_document.writexml(fo, indent='', addindent='\t', newl='\n', encoding="utf-8")
|
||||||
fo.close()
|
fo.close()
|
||||||
|
|||||||
@ -226,7 +226,7 @@ class fileUtils:
|
|||||||
img = Image.open(file_path)
|
img = Image.open(file_path)
|
||||||
img.verify()
|
img.verify()
|
||||||
img.close()
|
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
|
return True
|
||||||
except:
|
except:
|
||||||
if os.path.exists(file_path):
|
if os.path.exists(file_path):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user