Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
email.quoprimime._body_accumulator Class Reference

List of all members.

Public Member Functions

def __init__
def write_str
def newline
def write_soft_break
def write_wrapped
def write_char

Public Attributes

 eol
 maxlinelen
 room

Detailed Description

Definition at line 151 of file quoprimime.py.


Constructor & Destructor Documentation

def email.quoprimime._body_accumulator.__init__ (   self,
  maxlinelen,
  eol,
  args,
  kw 
)

Definition at line 153 of file quoprimime.py.

00153 
00154     def __init__(self, maxlinelen, eol, *args, **kw):
00155         super().__init__(*args, **kw)
00156         self.eol = eol
00157         self.maxlinelen = self.room = maxlinelen

Here is the caller graph for this function:


Member Function Documentation

Write eol, then start new line.

Definition at line 163 of file quoprimime.py.

00163 
00164     def newline(self):
00165         """Write eol, then start new line."""
00166         self.write_str(self.eol)
00167         self.room = self.maxlinelen

Here is the call graph for this function:

Here is the caller graph for this function:

def email.quoprimime._body_accumulator.write_char (   self,
  c,
  is_last_char 
)

Definition at line 179 of file quoprimime.py.

00179 
00180     def write_char(self, c, is_last_char):
00181         if not is_last_char:
00182             # Another character follows on this line, so we must leave
00183             # extra room, either for it or a soft break, and whitespace
00184             # need not be quoted.
00185             self.write_wrapped(c, extra_room=1)
00186         elif c not in ' \t':
00187             # For this and remaining cases, no more characters follow,
00188             # so there is no need to reserve extra room (since a hard
00189             # break will immediately follow).
00190             self.write_wrapped(c)
00191         elif self.room >= 3:
00192             # It's a whitespace character at end-of-line, and we have room
00193             # for the three-character quoted encoding.
00194             self.write(quote(c))
00195         elif self.room == 2:
00196             # There's room for the whitespace character and a soft break.
00197             self.write(c)
00198             self.write_soft_break()
00199         else:
00200             # There's room only for a soft break.  The quoted whitespace
00201             # will be the only content on the subsequent line.
00202             self.write_soft_break()
00203             self.write(quote(c))
00204 

Write a soft break, then start a new line.

Definition at line 168 of file quoprimime.py.

00168 
00169     def write_soft_break(self):
00170         """Write a soft break, then start a new line."""
00171         self.write_str('=')
00172         self.newline()

Here is the call graph for this function:

Here is the caller graph for this function:

Add string s to the accumulated body.

Definition at line 158 of file quoprimime.py.

00158 
00159     def write_str(self, s):
00160         """Add string s to the accumulated body."""
00161         self.write(s)
00162         self.room -= len(s)

Here is the caller graph for this function:

def email.quoprimime._body_accumulator.write_wrapped (   self,
  s,
  extra_room = 0 
)
Add a soft line break if needed, then write s.

Definition at line 173 of file quoprimime.py.

00173 
00174     def write_wrapped(self, s, extra_room=0):
00175         """Add a soft line break if needed, then write s."""
00176         if self.room < len(s) + extra_room:
00177             self.write_soft_break()
00178         self.write_str(s)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 155 of file quoprimime.py.

Definition at line 156 of file quoprimime.py.

Definition at line 156 of file quoprimime.py.


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