Re: Pickle to source code

2005-10-26 Thread Gabriel Genellina
Olivier Dormond ha escrito: > > xxx = new.instance(MyClass, {'a':1,'b':2,'done':1}) > > > > In other words, I need a *string* which, being sent to eval(), would > > return the original object state saved in the pickle. > > Doesn't pickle.loads just do what you need ? e.g.: > > >>> pickled = file('

Re: Pickle to source code

2005-10-26 Thread Gabriel Genellina
Jean-Paul Calderone ha escrito: > >In other words, I need a *string* which, being sent to eval(), would > >return the original object state saved in the pickle. > > You may find twisted.persisted.aot of some use. Here is an example: > > AOT is unmaintained in Twisted, and may not support some ne

Re: Pickle to source code

2005-10-26 Thread Olivier Dormond
Gabriel Genellina wrote: > Or perhaps: > > xxx = new.instance(MyClass, {'a':1,'b':2,'done':1}) > > In other words, I need a *string* which, being sent to eval(), would > return the original object state saved in the pickle. > As has been pointed, repr() would do that for simple types. But I need

Re: Pickle to source code

2005-10-26 Thread Jean-Paul Calderone
On 26 Oct 2005 06:15:35 -0700, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> I want to convert from pickle format to python source code. That is, >> given an existing pickle, I want to produce a textual representation >> which, when evaluated, yields the original object (as if I had >> unpickled

Re: Pickle to source code

2005-10-26 Thread Gabriel Genellina
> I want to convert from pickle format to python source code. That is, > given an existing pickle, I want to produce a textual representation > which, when evaluated, yields the original object (as if I had > unpickled the pickle). > I know of some transformations pickle/xml (Zope comes with one su

Re: Pickle to source code

2005-10-26 Thread Gabriel Genellina
Maksim Kasimov ha escrito: > As far i know, in pickle-file there are only attributes values of a pickled > object, but not an object itself. > > It is possible to unpickle object only if you have the sourse of the class > that object you have pickled. > So, if you have class code and attribute

Re: Pickle to source code

2005-10-26 Thread Gabriel Genellina
Benjamin Niemann ha escrito: > Gabriel Genellina wrote: > > > I want to convert from pickle format to python source code. That is, > > given an existing pickle, I want to produce a textual representation > > which, when evaluated, yields the original object (as if I had > > If all objects correctl

Re: Pickle to source code

2005-10-26 Thread Maksim Kasimov
As far i know, in pickle-file there are only attributes values of a pickled object, but not an object itself. It is possible to unpickle object only if you have the sourse of the class that object you have pickled. So, if you have class code and attribute values of the class instance, there is

Re: Pickle to source code

2005-10-26 Thread Benjamin Niemann
Gabriel Genellina wrote: > I want to convert from pickle format to python source code. That is, > given an existing pickle, I want to produce a textual representation > which, when evaluated, yields the original object (as if I had > unpickled the pickle). > I know of some transformations pickle/x

Pickle to source code

2005-10-26 Thread Gabriel Genellina
Hello I want to convert from pickle format to python source code. That is, given an existing pickle, I want to produce a textual representation which, when evaluated, yields the original object (as if I had unpickled the pickle). I know of some transformations pickle/xml (Zope comes with one such