def __makeBlob(self, store): dg = PyDatagram() if self.__list: dg.addUint8(CatalogItem.CatalogItemVersion) for item in self.__list: CatalogItem.encodeCatalogItem(dg, item, store) return dg.getMessage()
def __makeBlob(self, store): # Construct a new datagram and fill it up with the items in # the list. dg = PyDatagram() if self.__list: # empty list or None means nothing on the list. dg.addUint8(CatalogItem.CatalogItemVersion) for item in self.__list: CatalogItem.encodeCatalogItem(dg, item, store) return dg.getMessage()
def __makeList(self, store): list = [] if self.__blob: dg = PyDatagram(self.__blob) di = PyDatagramIterator(dg) versionNumber = di.getUint8() while di.getRemainingSize() > 0: item = CatalogItem.decodeCatalogItem(di, versionNumber, store) list.append(item) return list
def __makeList(self, store): # Construct a new list and populate it with the items decoded # from the blob. list = [] if self.__blob: # empty string or None means nothing on the list. dg = PyDatagram(self.__blob) di = PyDatagramIterator(dg) versionNumber = di.getUint8() while di.getRemainingSize() > 0: item = CatalogItem.decodeCatalogItem(di, versionNumber, store) list.append(item) return list