From: <zk...@us...> - 2009-03-20 12:11:13
|
Revision: 625 http://pyphant.svn.sourceforge.net/pyphant/?rev=625&view=rev Author: zklaus Date: 2009-03-20 12:11:08 +0000 (Fri, 20 Mar 2009) Log Message: ----------- Converting each list element individually to strings before saving them to HDF. Modified Paths: -------------- trunk/src/pyphant/pyphant/core/PyTablesPersister.py Modified: trunk/src/pyphant/pyphant/core/PyTablesPersister.py =================================================================== --- trunk/src/pyphant/pyphant/core/PyTablesPersister.py 2009-03-20 12:10:07 UTC (rev 624) +++ trunk/src/pyphant/pyphant/core/PyTablesPersister.py 2009-03-20 12:11:08 UTC (rev 625) @@ -177,11 +177,12 @@ def saveField(h5, resultGroup, result): def dump(inputList): + def conversion(arg): + if type(arg) == type(u' '): + return arg.encode('utf-8') + else: + return arg.__repr__() if type(inputList)==type([]): - if type(inputList[0])==type(u' '): - conversion = lambda s: s.encode('utf-8') - else: - conversion = lambda s: s.__repr__() return map(conversion,inputList) else: return map(dump,inputList) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |