コード例 #1
0
ファイル: streams.py プロジェクト: fedora-conary/conary
 def thaw(self, frz):
     del self[:]
     if not frz:
         return
     i = 0
     while i < len(frz):
         i, (s,) = pack.unpack("!D", i, frz)
         self.append(s)
コード例 #2
0
 def thaw(self, frz):
     del self[:]
     if not frz:
         return
     i = 0
     while i < len(frz):
         i, (s, ) = pack.unpack("!D", i, frz)
         self.append(s)
コード例 #3
0
ファイル: streams.py プロジェクト: fedora-conary/conary
    def _thaw(self):
        i = 0
        self._thawedItems = dict([ (x, []) for x in self.streamDict ])

        while (i < len(self._data)):
            i, (typeId, s) = pack.unpack('!BD', i, self._data)
            item = self.streamDict[typeId](s)
            self._thawedItems[typeId].append(item)

        assert(i == len(self._data))
        self._data = None
コード例 #4
0
ファイル: streams.py プロジェクト: fedora-conary/conary
    def _thaw(self):
        i = 0
        self._thawedItems = dict([ (x, {}) for x in self.streamDict ])

        while (i < len(self._data)):
            i, (typeId, s) = pack.unpack("!BSH", i, self._data)
            item = self.streamDict[typeId](s)
            self._thawedItems[typeId][item] = True

        assert(i == len(self._data))
        self._data = None
コード例 #5
0
    def _thaw(self):
        i = 0
        self._thawedItems = dict([(x, []) for x in self.streamDict])

        while (i < len(self._data)):
            i, (typeId, s) = pack.unpack('!BD', i, self._data)
            item = self.streamDict[typeId](s)
            self._thawedItems[typeId].append(item)

        assert (i == len(self._data))
        self._data = None
コード例 #6
0
    def _thaw(self):
        i = 0
        self._thawedItems = dict([(x, {}) for x in self.streamDict])

        while (i < len(self._data)):
            i, (typeId, s) = pack.unpack("!BSH", i, self._data)
            item = self.streamDict[typeId](s)
            self._thawedItems[typeId][item] = True

        assert (i == len(self._data))
        self._data = None
コード例 #7
0
ファイル: streams.py プロジェクト: fedora-conary/conary
    def twm(self, diff, base):
        assert(self == base)
        numRemoved, numAdded = struct.unpack("!HH", diff[0:4])
        i = 4

        for x in xrange(numRemoved + numAdded):
            i, (typeId, s) = pack.unpack("!BD", i, diff)
            item = self.streamDict[typeId](s)
            if x < numRemoved:
                l = self._items[typeId]
                del l[l.index(item)]
            else:
                self._items[typeId].append(item)
コード例 #8
0
    def twm(self, diff, base):
        assert (self == base)
        numRemoved, numAdded = struct.unpack("!HH", diff[0:4])
        i = 4

        for x in xrange(numRemoved + numAdded):
            i, (typeId, s) = pack.unpack("!BD", i, diff)
            item = self.streamDict[typeId](s)
            if x < numRemoved:
                l = self._items[typeId]
                del l[l.index(item)]
            else:
                self._items[typeId].append(item)