Re: Redundant code in multiple methods

2005-09-13 Thread bruno modulix
Rob Conner wrote: > Genius! Nope. Just common Python idioms... > Thanks guys that was exactly the help I was looking for. I'll be > implementing this later today. I don't forsee any problems, so if I > don't post anything else, thank you so much for the help. You're welcome. -- bruno desthuill

Re: Redundant code in multiple methods

2005-09-13 Thread Rob Conner
Genius! Thanks guys that was exactly the help I was looking for. I'll be implementing this later today. I don't forsee any problems, so if I don't post anything else, thank you so much for the help. -- http://mail.python.org/mailman/listinfo/python-list

Re: Redundant code in multiple methods

2005-09-12 Thread bruno modulix
Rob Conner wrote: > No you don't need to know Zope to help me. The whole reason I'd even > want to do this is because of Zope though. I made a Zope product, and > now want to perfect it. > > some simple example code... > > > class User: > > def View(self): > # play with data here >

Re: Redundant code in multiple methods

2005-09-09 Thread Sam Pointon
How about using a class, with __call__, as a wrapper instead of the function itself? class FunctionWrapper(object): def __init__(self, cls, function): self._function = function self._cls = cls def __call__(self, *args, **kwargs): REQUEST = self.REQUEST SE

Redundant code in multiple methods

2005-09-09 Thread Rob Conner
No you don't need to know Zope to help me. The whole reason I'd even want to do this is because of Zope though. I made a Zope product, and now want to perfect it. some simple example code... class User: def View(self): # play with data here myHtmlDoc = "pretend this is a upe