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

Method update

python/cinbase/config.py:167–236  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

165
166 # check if the config files are changed and relaod as needed
167 def update(self):
168 # avoid checking mtime of files too frequently
169 if (time.time() - self._lastUpdateTime) < 3.0:
170 return
171
172 try:
173 configTime = os.path.getmtime(self.getConfigFile())
174 except Exception:
175 configTime = 0.0
176
177 datadirs = (self.getConfigDir(), self.getDataDir())
178 symbolsTime = 0.0
179 symbolsFile = self.findFile(datadirs, "symbols.dat")
180 if symbolsFile:
181 try:
182 symbolsTime = os.path.getmtime(symbolsFile)
183 except Exception:
184 pass
185
186 ezSymbolsTime = 0.0
187 ezSymbolsFile = self.findFile(datadirs, "swkb.dat")
188 if ezSymbolsFile:
189 try:
190 ezSymbolsTime = os.path.getmtime(ezSymbolsFile)
191 except Exception:
192 pass
193
194 fsymbolsTime = 0.0
195 fsymbolsFile = self.findFile(datadirs, "fsymbols.dat")
196 if fsymbolsFile:
197 try:
198 fsymbolsTime = os.path.getmtime(fsymbolsFile)
199 except Exception:
200 pass
201
202 flangsTime = 0.0
203 flangsFile = self.findFile(datadirs, "flangs.dat")
204 if flangsFile:
205 try:
206 flangsTime = os.path.getmtime(flangsFile)
207 except Exception:
208 pass
209
210 userphraseTime = 0.0
211 userphraseFile = self.findFile(datadirs, "userphrase.dat")
212 if userphraseFile:
213 try:
214 userphraseTime = os.path.getmtime(userphraseFile)
215 except Exception:
216 pass
217
218 extendtableTime = 0.0
219 extendtableFile = self.findFile(datadirs, "extendtable.dat")
220 if extendtableFile:
221 try:
222 extendtableTime = os.path.getmtime(extendtableFile)
223 except Exception:
224 pass

Callers 15

loadMethod · 0.95
saveMethod · 0.95
customizeUIMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
checkConfigChangeMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
saveCountFileMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 6

getConfigFileMethod · 0.95
getConfigDirMethod · 0.95
getDataDirMethod · 0.95
findFileMethod · 0.95
loadMethod · 0.95
timeMethod · 0.80

Tested by 3

produceMethod · 0.36
consumeMethod · 0.36
add_routesMethod · 0.36