コード例 #1
0
	def loadState(self):
		try:
			assert(os.path.exists(self.statePath))
			tmp = utils.PersistentDict(self.statePath, ' = ')
			pingDict = {}
			for wms in tmp:
				isOK, ping, ping_time = tuple(tmp[wms].split(',', 2))
				if utils.parseBool(isOK):
					pingDict[wms] = (parseStr(ping, float), parseStr(ping_time, float, 0))
			return (pingDict.keys(), tmp.keys(), pingDict, 0)
		except Exception:
			return ([], [], {}, None)
コード例 #2
0
	def updateState(self):
		tmp = {}
		for wms in self.wms_all:
			pingentry = self.pingDict.get(wms, (None, 0))
			tmp[wms] = '%r,%s,%s' % (wms in self.wms_ok, pingentry[0], pingentry[1])
		utils.PersistentDict(self.statePath, ' = ').write(tmp)
コード例 #3
0
ファイル: cfiller_base.py プロジェクト: whahmad/grid-control
	def __init__(self, persistencyFile):
		self._persistencyDict = {}
		if os.path.exists(persistencyFile):
			self._persistencyDict = utils.PersistentDict(persistencyFile, ' = ')