MCPcopy
hub / github.com/tonquer/JMComic-qt / SaveFile

Method SaveFile

src/tools/tool.py:1053–1071  ·  view source on GitHub ↗
(data, filePath)

Source from the content-addressed store, hash-verified

1051
1052 @staticmethod
1053 def SaveFile(data, filePath):
1054 if not data:
1055 return
1056 if not filePath:
1057 return
1058
1059 try:
1060 fileDir = os.path.dirname(filePath)
1061
1062 if not os.path.isdir(fileDir):
1063 os.makedirs(fileDir)
1064
1065 with open(filePath, "wb+") as f:
1066 f.write(data)
1067
1068 Log.Debug("add chat cache, cachePath:{}".format(filePath))
1069
1070 except Exception as es:
1071 Log.Error(es)
1072
1073 @staticmethod
1074 def GetComicInfoXml(epsId, picNum, bookInfo):

Callers

nothing calls this directly

Calls 3

writeMethod · 0.80
DebugMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected