swf format verification?

2007-02-14 Thread akonsu
hello, can someone recommend a good library to verify whether a file is in swf format (and ideally flv as well)? i need it to enable file uploading on to my web site. thanks konstantin -- http://mail.python.org/mailman/listinfo/python-list

how to add property "dynamically"?

2008-08-16 Thread akonsu
hello, i need to add properties to instances dynamically during run time. this is because their names are determined by the database contents. so far i found a way to add methods on demand: class A(object) : def __getattr__(self, name) : if name == 'test' : def f() : retur

Re: nested structure with "internal references"

2009-09-25 Thread akonsu
On Sep 25, 1:11 pm, Torsten Mohr wrote: > Hi, > > sorry for posting in german before, that was a mistake. > > I'd like to use a nested structure in memory that consists > of dict()s and list()s, list entries can be dict()s, other list()s, > dict entries can be list()s or other dict()s. > > The lis

Re: nested structure with "internal references"

2009-09-25 Thread akonsu
put a (name, value) pair in each list element instead of just value and reference them by name, you can use uuid to generate names konstantin -- http://mail.python.org/mailman/listinfo/python-list

module path?

2009-09-28 Thread akonsu
hello, is there a way to determine the file location of a loaded module? assuming it is not built in. import settings print settings produces: i would like to get to this path somehow other than by parsing the string representation of the module. is there a property on types.ModuleType? i coul

Re: module path?

2009-09-28 Thread akonsu
On Sep 28, 7:51 pm, Steven D'Aprano wrote: > On Mon, 28 Sep 2009 16:41:36 -0700, akonsu wrote: > > hello, > > > is there a way to determine the file location of a loaded module? > > assuming it is not built in. > > > import settings > > print settings &

something like perl's Mail::GPG ?

2009-08-13 Thread akonsu
hello, i am looking for a module with functionality similar to that of the Perl's Mail::GPG package. I need to verify multipart emails that are PGP-signed. thanks for any advice konstantin -- http://mail.python.org/mailman/listinfo/python-list

Re: coding for multiple versions of python

2009-08-13 Thread akonsu
On Aug 13, 12:57 pm, "Tim Arnold" wrote: > Hi, > I've got a python based system that has to run on hp unix and red hat linux. > The Python version on the HP is 2.4 and the version on the Linux box is 2.6. > There's nothing I can do about that. > > I think that means I must have two different libra

cleanup in sys.excepthook?

2009-09-23 Thread akonsu
hello, my script creates files that i need to delete if an exception is thrown. is this a good pythonic style to do this kind of cleanup in sys.excepthook instead of inside except clause of a try block? konstantin -- http://mail.python.org/mailman/listinfo/python-list

Re: Very simple finite automaton (?)

2009-09-23 Thread akonsu
On Sep 23, 1:24 am, kpp9c wrote: > Very simple finite automaton (?) > > 1 --> 2 5 > 2 --> 1 4 > 3 --> 3 > 4 --> 1 > 5 --> 4 3 > hello, this is a graph and you are doing depth first search. konstantin -- http://mail.python.org/mailman/listinfo/python-list

Re: Very simple finite automaton (?)

2009-09-23 Thread akonsu
On Sep 23, 11:49 am, akonsu wrote: > On Sep 23, 1:24 am, kpp9c wrote: > > > Very simple finite automaton (?) > > > 1 --> 2 5 > > 2 --> 1 4 > > 3 --> 3 > > 4 --> 1 > > 5 --> 4 3 > > hello, > this is a graph and you are doi

Re: cleanup in sys.excepthook?

2009-09-23 Thread akonsu
On Sep 23, 11:57 am, Jean-Michel Pichavant wrote: > akonsu wrote: > > hello, > > > my script creates files that i need to delete if an exception is > > thrown. > > > is this a good pythonic style to do this kind of cleanup in > > sys.excepthook instead

Re: Idiom for "last word in a string"

2009-09-23 Thread akonsu
On Sep 23, 2:47 pm, Grant Edwards wrote: > I recently ran across this construct for grabbing the last > (whitespace delimited) word in a string: > >    s.rsplit(None,1)[1] > > It was somewhat obvious from the context what it was supposed > to do, but it took a bit of Googling to figure out exactly

logging.handlers.SMTPHandler question

2009-09-23 Thread akonsu
hello, SMTPHAndler seems to email every single record separately. is there a way to collect all log output and then send it in a single email message? or do i have to do it manually? thanks konstantin -- http://mail.python.org/mailman/listinfo/python-list