Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Member Functions
binhex._Hqxcoderengine Class Reference

List of all members.

Public Member Functions

def __init__
def write
def close

Public Attributes

 ofp
 data
 hqxdata
 linelen

Private Member Functions

def _flush

Detailed Description

Write data to the coder in 3-byte chunks

Definition at line 79 of file binhex.py.


Constructor & Destructor Documentation

def binhex._Hqxcoderengine.__init__ (   self,
  ofp 
)

Definition at line 82 of file binhex.py.

00082 
00083     def __init__(self, ofp):
00084         self.ofp = ofp
00085         self.data = b''
00086         self.hqxdata = b''
00087         self.linelen = LINELEN - 1

Here is the caller graph for this function:


Member Function Documentation

def binhex._Hqxcoderengine._flush (   self,
  force 
) [private]

Definition at line 99 of file binhex.py.

00099 
00100     def _flush(self, force):
00101         first = 0
00102         while first <= len(self.hqxdata) - self.linelen:
00103             last = first + self.linelen
00104             self.ofp.write(self.hqxdata[first:last] + b'\n')
00105             self.linelen = LINELEN
00106             first = last
00107         self.hqxdata = self.hqxdata[first:]
00108         if force:
00109             self.ofp.write(self.hqxdata + b':\n')

Here is the caller graph for this function:

Definition at line 110 of file binhex.py.

00110 
00111     def close(self):
00112         if self.data:
00113             self.hqxdata = self.hqxdata + binascii.b2a_hqx(self.data)
00114         self._flush(1)
00115         self.ofp.close()
00116         del self.ofp

Here is the call graph for this function:

def binhex._Hqxcoderengine.write (   self,
  data 
)

Definition at line 88 of file binhex.py.

00088 
00089     def write(self, data):
00090         self.data = self.data + data
00091         datalen = len(self.data)
00092         todo = (datalen // 3) * 3
00093         data = self.data[:todo]
00094         self.data = self.data[todo:]
00095         if not data:
00096             return
00097         self.hqxdata = self.hqxdata + binascii.b2a_hqx(data)
00098         self._flush(0)

Here is the call graph for this function:


Member Data Documentation

Definition at line 84 of file binhex.py.

Definition at line 85 of file binhex.py.

Definition at line 86 of file binhex.py.

Definition at line 83 of file binhex.py.


The documentation for this class was generated from the following file: