MCPcopy Create free account
hub / github.com/EasyIME/PIME / saveCountFile

Method saveCountFile

python/cinbase/cin.py:214–227  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

212
213
214 def saveCountFile(self):
215 filename = self.getCountFile()
216 tempcincount = {}
217
218 if os.path.exists(filename) and not os.stat(filename).st_size == 0:
219 with open(filename, "r") as f:
220 tempcincount.update(json.load(f))
221
222 if not tempcincount == self.cincount:
223 try:
224 with open(filename, "w") as f:
225 js = json.dump(self.cincount, f, sort_keys=True, indent=4)
226 except Exception:
227 pass # FIXME: handle I/O errors?
228
229
230 def getCountDir(self):

Callers 2

__init__Method · 0.95
checkConfigChangeMethod · 0.80

Calls 3

getCountFileMethod · 0.95
updateMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected