Added script eggify.py for wrapping a Python module into an egg, and plenty of minor improvements and refactorings.

This commit is contained in:
Gaetan Delannay 2010-11-26 17:30:46 +01:00
parent aea19a819e
commit 52816ec343
23 changed files with 2048 additions and 1760 deletions

View file

@ -486,11 +486,18 @@ class MemoryBuffer(Buffer):
else:
res = self.getLength()
return res
reTagContent = re.compile('<(?P<p>[\w-]+):(?P<f>[\w-]+)(.*?)>.*</(?P=p):' \
'(?P=f)>', re.S)
def evaluate(self, subElements=True, removeMainElems=False):
#print 'Evaluating buffer', self.content.encode('utf-8'), self.elements
result = self.getFileBuffer()
if not subElements:
result.write(self.content)
# Dump the root tag in this buffer, but not its content.
res = self.reTagContent.match(self.content.strip())
if not res: result.write(self.content)
else:
g = res.group
result.write('<%s:%s%s></%s:%s>' % (g(1),g(2),g(3),g(1),g(2)))
else:
iter = BufferIterator(self)
currentIndex = self.getStartIndex(removeMainElems)
@ -505,8 +512,6 @@ class MemoryBuffer(Buffer):
PodError.dump(result, EVAL_EXPR_ERROR % (
evalEntry.expr, e), dumpTb=False)
else: # It is a subBuffer
#print '******Subbuffer*************'
# This is a bug.
if evalEntry.action:
evalEntry.action.execute()
else:

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,17 @@
class Student:
def __init__(self, **kwargs):
for k, v in kwargs.iteritems():
setattr(self, k, v)
students = [
Student(parent_guardian='Parent 1', street='Street 1', city='Flawinne',
state='Namur', zip='5020', lname='Name 1', fname='First name 1'),
Student(parent_guardian='Parent 2', street='Street 2', city='Flawinne',
state='Namur', zip='5020', lname='Name 2', fname='First name 2'),
Student(parent_guardian='Parent 3', street='Street 3', city='Flawinne',
state='Namur', zip='5020', lname='Name 3', fname='First name 3'),
Student(parent_guardian='Parent 4', street='Street 4', city='Flawinne',
state='Namur', zip='5020', lname='Name 4', fname='First name 4'),
Student(parent_guardian='Parent 5', street='Street 5', city='Flawinne',
state='Namur', zip='5020', lname='Name 5', fname='First name 5'),
]

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.