creating yaml without tags using pyyaml
hello I have a situation where I have quite a large python object which I want to convert to yaml so I can then send it to a flex application using pyamf. I've managed to create a yaml document using the python object (http://flashbsm.googlecode.com/svn/testing/yamlTest/tester.yaml) (using pyyaml) however when I send the result of decoding the python object to yaml to the flex app, the flex app complains about expecting a block end, but not getting one. I have come to the conclusion that this is the fault of the tags (for example, !!python/tuple) as getting rid of them gets rid of the errors. So I'm wondering if there is an option to YAML.decode that will create a yaml document without the tags? Thankyou Regards Stephen -- http://mail.python.org/mailman/listinfo/python-list
Re: creating yaml without tags using pyyaml
On Fri, Jun 6, 2008 at 8:20 PM, Kirill Simonov <[EMAIL PROTECTED]> wrote: > Stephen Moore wrote: >> >> I have come to the conclusion that this is the fault of the tags (for >> example, !!python/tuple) as getting rid of them gets rid of the >> errors. >> >> So I'm wondering if there is an option to YAML.decode that will create >> a yaml document without the tags? > > Try yaml.safe_dump(). > >>>> import yaml > >>>> print yaml.dump(()) > !!python/tuple [] > >>>> print yaml.safe_dump(()) > [] > > > Thanks, > Kirill > yes, that's exactly what I wanted :) however it still caused problems... but I've managed to make it so it doesn't use tuples and now it all seems to work. thankyou for your help anyways, it's greatly appreciated :) -- http://mail.python.org/mailman/listinfo/python-list
