Proper way of handling "plug-in" methods

2007-01-08 Thread Franck PEREZ
All, My application deals with strings formatting. I have built-in methods but I also expect the user to add its methods in its own .py files (some sort of plugin methods, all user methods should be exposed in my application). Here is the structure I have thought of : formatting.py _formattingDi

Re: Automatic class attribute

2006-02-03 Thread Franck PEREZ
On 2/3/06, Kirk McDonald <[EMAIL PROTECTED]> wrote: > Franck PEREZ wrote: > > Hello all, > > > > Considering the following code : > > > > class C(object): > >...: observers = [] > >...: > >...: @classmethod > >

Automatic class attribute

2006-02-03 Thread Franck PEREZ
Hello all, Considering the following code : class C(object): ...: observers = [] ...: ...: @classmethod ...: def showObservers(cls): ...: print cls.observers class D1(C): ...: observers = [] #could it be moved in C ? class D2(C): ...: observers =

[ANN] XML Serializer module

2006-01-12 Thread Franck PEREZ
Dear all, I wished to announce here my first Python module : XML Serializer. It recursively serializes and deserializes Python objects and their children. Children may be an instance's attributes, or list/dict/tuple elements. When serializing an instance, you may customize the attributes which ar

Re: books: Dive into Python vs Beginning Python

2005-11-25 Thread Franck PEREZ
On 11/25/05, Sebastien Douche <[EMAIL PROTECTED]> wrote: > On 11/25/05, Franz Mueller <[EMAIL PROTECTED]> wrote: > > Hi, > > Hi Franz! :) > > > which of the following books would you recommend: > > "Dive into Python" or "Beginning Python: From Novice to Professional"? > > Both are very good books b

Re: Importing a class without knowing the module

2005-11-18 Thread Franck PEREZ
On 11/18/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > Mike Meyer <[EMAIL PROTECTED]> wrote: > >... > >> >> >> How about adding Foo.__file__ to the serialized data? > >... > >> >> depends on somewhere on it. You can use the module name if you have

Re: Importing a class without knowing the module

2005-11-17 Thread Franck PEREZ
I thought about it, but it would make the XML file depend on the machine... no more portability... On 11/18/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > Franck PEREZ <[EMAIL PROTECTED]> writes: > > ### My test application > > class Foo(object): &

Importing a class without knowing the module

2005-11-17 Thread Franck PEREZ
Hello, I'm developing a small XML marshaller and I'm facing an annoying issue. Here's some sample code: ### My test application class Foo(object): #The class I'd like to serialize pass import myMarshaller foo = Foo() s = myMarshaller.dumps(foo) #works fine, spits somethi