Exemplo n.º 1
0
 def pull_frame(self):
     try:
         frame = self.oframes.get(block=False)
         for byte in frame:
             for bit in utils.to_bits(ord(byte)):
                 self.oframe.append(bit)
     except Queue.Empty:
         pass
Exemplo n.º 2
0
 def pull_frame(self):
     try:
         frame = self.oframes.get(block=False)
         for byte in frame:
             for bit in utils.to_bits(ord(byte)):
                 self.oframe.append(bit)
     except Queue.Empty:
         pass
Exemplo n.º 3
0
 def pull_frame(self):
     try:
         frame = self._oframes.popleft()
         self.obuffer_used -= len(frame)
         self._oframe.clear()
         self._oframe.extend(self.FLAG)
         for byte in frame:
             for bit in utils.to_bits(ord(byte)):
                 self._oframe.append(bit)
                 if self._successive_bits_detector.feed(bit):
                     self._oframe.append(0)
         self._successive_bits_detector.clear()
         self._oframe.extend(self.FLAG)
     except IndexError:
         pass
Exemplo n.º 4
0
 def pull_frame(self):
     try:
         frame = self._oframes.popleft()
         self.obuffer_used -= len(frame)
         self._oframe.clear()
         self._oframe.extend(self.FLAG)
         for byte in frame:
             for bit in utils.to_bits(ord(byte)):
                 self._oframe.append(bit)
                 if self._successive_bits_detector.feed(bit):
                     self._oframe.append(0)
         self._successive_bits_detector.clear()
         self._oframe.extend(self.FLAG)
     except IndexError:
         pass