Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
MHMailbox Class Reference

Public Member Functions

def __init__
 
def __iter__
 
def next
 

Data Fields

 dirname
 
 boxes
 
 factory
 

Detailed Description

Definition at line 183 of file mailbox.py.

Constructor & Destructor Documentation

def __init__ (   self,
  dirname,
  factory = rfc822.Message 
)

Definition at line 184 of file mailbox.py.

185  def __init__(self, dirname, factory=rfc822.Message):
186  import re
187  pat = re.compile('^[1-9][0-9]*$')
188  self.dirname = dirname
189  # the three following lines could be combined into:
190  # list = map(long, filter(pat.match, os.listdir(self.dirname)))
191  list = os.listdir(self.dirname)
192  list = filter(pat.match, list)
193  list = map(long, list)
194  list.sort()
195  # This only works in Python 1.6 or later;
196  # before that str() added 'L':
197  self.boxes = map(str, list)
198  self.factory = factory

Member Function Documentation

def __iter__ (   self)

Definition at line 199 of file mailbox.py.

References _Mailbox.next(), Tokenizer.next, MHMailbox.next(), and Breakpoint.next.

200  def __iter__(self):
201  return iter(self.next, None)
def next (   self)

Definition at line 202 of file mailbox.py.

References MHMailbox.boxes, MHMailbox.dirname, _Mailbox.factory, MHMailbox.factory, and aifc.open().

203  def next(self):
204  if not self.boxes:
205  return None
206  fn = self.boxes[0]
207  del self.boxes[0]
208  fp = open(os.path.join(self.dirname, fn))
209  return self.factory(fp)
210 

Field Documentation

boxes

Definition at line 196 of file mailbox.py.

dirname

Definition at line 187 of file mailbox.py.

factory

Definition at line 197 of file mailbox.py.


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