Re: setattr in class

2008-09-12 Thread Bojan Mihelac
On Sep 12, 5:35 pm, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Fri, 12 Sep 2008 08:08:18 -0700 (PDT), Bojan Mihelac wrote: > > Hi all - when trying to set some dynamic attributes in class, for > > example: > > > class A: > >     for lang in ['1', &

Re: setattr in class

2008-09-12 Thread Bojan Mihelac
On Sep 12, 5:21 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > Bojan Mihelac wrote: > > I guess A class not yet exists in line 4. Is it possible to achive > > adding dynamic attributes without using exec? > > Correct, the class doesn't exist until the end of the

setattr in class

2008-09-12 Thread Bojan Mihelac
Hi all - when trying to set some dynamic attributes in class, for example: class A: for lang in ['1', '2']: exec('title_%s = lang' % lang) #this work but is ugly # setattr(A, "title_%s" % lang, lang) # this wont work setattr(A, "title_1", "x") # this work when outside class p

Re: Python and M2Crypto question

2008-09-09 Thread Bojan Mihelac
Graham, thanks, I will try with that. On Sep 8, 1:02 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Sep 7, 11:07 pm, Bojan Mihelac <[EMAIL PROTECTED]> wrote: > > > Hi all! > > > I am trying to install M2Crypto to work on OSX10.5 apache > > (mod_py

Python and M2Crypto question

2008-09-07 Thread Bojan Mihelac
Hi all! I am trying to install M2Crypto to work on OSX10.5 apache (mod_python). Error I receive: Error was: dlopen(/Library/WebServer/eggs/M2Crypto-0.18.2-py2.5- macosx-10.5-i386.egg-tmp/M2Crypto/__m2crypto.so, 2): no suitable image found. Did find: /Library/WebServer/eggs/M2Crypto-0.18.