コード例 #1
0
 def write(self, data):
     # If it's the first big chunk (header)
     # Tweak the volume information to match what we expect.
     if FIXUP_DURING_RECEIVE and self.bytesWritten == 0:
         data = send.replaceIDs(
             data,
             self.diff.toUUID,
             self.diff.toGen,
             self.diff.fromUUID,
             self.diff.fromGen,
         )
     self.stream.write(data)
     self.bytesWritten += len(data)
     if self.progress is not None:
         self.progress.update(self.bytesWritten)
コード例 #2
0
ファイル: Butter.py プロジェクト: AmesCornish/buttersink
 def write(self, data):
     # If it's the first big chunk (header)
     # Tweak the volume information to match what we expect.
     if FIXUP_DURING_RECEIVE and self.bytesWritten == 0:
         data = send.replaceIDs(
             data,
             self.diff.toUUID,
             self.diff.toGen,
             self.diff.fromUUID,
             self.diff.fromGen,
         )
     self.stream.write(data)
     self.bytesWritten += len(data)
     if self.progress is not None:
         self.progress.update(self.bytesWritten)
コード例 #3
0
 def read(self, size):
     # If it's the first big chunk (header)
     # Tweak the volume information to match what we expect.
     data = self.stream.read(size)
     if FIXUP_DURING_SEND and self.bytesRead == 0:
         data = send.replaceIDs(
             data,
             self.diff.toUUID,
             self.diff.toGen,
             self.diff.fromUUID,
             self.diff.fromGen,
         )
     self.bytesRead += len(data)
     if self.progress is not None:
         self.progress.update(self.bytesRead)
     return data
コード例 #4
0
ファイル: Butter.py プロジェクト: AmesCornish/buttersink
 def read(self, size):
     # If it's the first big chunk (header)
     # Tweak the volume information to match what we expect.
     data = self.stream.read(size)
     if FIXUP_DURING_SEND and self.bytesRead == 0:
         data = send.replaceIDs(
             data,
             self.diff.toUUID,
             self.diff.toGen,
             self.diff.fromUUID,
             self.diff.fromGen,
         )
     self.bytesRead += len(data)
     if self.progress is not None:
         self.progress.update(self.bytesRead)
     return data