def edit(self, account, requestID, idTypeList, data, ob=None, **kw): adapteddata = getFromCache(idTypeList, self._iface.ifacename) or dict(ids=[]) if isinstance(data, long): adapteddata['ids'].append(str(data)) setToCache(idTypeList, self._iface.ifacename, adapteddata) return adapteddata
def cacheIFaceData(respdata): for data, idTypeList in respdata: for ifacename in data: if data[ifacename]: setToCache(idTypeList, ifacename, data[ifacename]) else: deleteFromCache(idTypeList, ifacename)
def onHangarSpacesHashChanged(event): import BWPersonality from clientConsts import GUI_TYPES activeEventsCRC32 = BWPersonality.g_settings.hangarSpaceSettings[ 'eventsHash'] if event.ob.get( 'hash', '' ) != activeEventsCRC32 and BWPersonality.g_initPlayerInfo.useGUIType == GUI_TYPES.PREMIUM: accountUI = g_windowsManager.getAccountUI() if accountUI: data = dict(hash=activeEventsCRC32) accountUI.editIFace([[{ event.iface.ifacename: data }, EMPTY_IDTYPELIST]]) setToCache(EMPTY_IDTYPELIST, event.iface.ifacename, data)
def cachedata(ifacesFromCache): for obid in transformedResponse: for obtype in transformedResponse[obid]: idTypeList = joinIDTypeList(listFromId(obid), listFromId(obtype)) idList, typeList = splitIDTypeList(idTypeList) ids = idFromList(idList) types = idFromList(typeList) for parentName, ifaces in transformedResponse[obid][ obtype].iteritems(): for ifacename, attrs in ifaces.iteritems(): if not ifacesFromCache.get(ids, {}).get( types, {}).get(ifacename, False): if attrs: setToCache(idTypeList, ifacename, attrs) else: deleteFromCache(idTypeList, ifacename) else: transformedResponse[obid][obtype][ parentName][ifacename] = getFromCache( idTypeList, ifacename) or {}
def add(self, account, requestID, data, **kw): from exchangeapi.EventUtils import generateEvent setToCache(kw['idTypeList'], self._iface.ifacename, data) generateEvent('add', 'add', self._iface.ifacename, kw['idTypeList'], account, data) return data
def add(self, account, requestID, data, **kw): kw['idTypeList'][0][0] = generateID() setToCache(kw['idTypeList'], self._iface.ifacename, data) return data
def edit(self, account, requestID, idTypeList, data, ob=None, **kw): from Helpers.cache import setToCache setToCache(idTypeList, self._iface.ifacename, data) return data