Custom Query (132 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (25 - 27 of 132)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Ticket Resolution Summary Owner Reporter
#167 worksforme Please help saving dict to yaml xi anonymous

Reported by anonymous, 4 years ago.

Description
Hi, is there any way of saving dict to a file in yaml format? I'm using:
----------------------------------------
#!/usr/bin/python
import yaml
y = """
    root:
         - subject1:
            desc: msg1
         - subject2:
            desc: msg2
"""
settings=yaml.load(y)

settings['root'][0]['subject1']['desc'] = "new msg"
print settings

f = open("temp", "w")
f.write(str(settings))
----------------------------------------
but failing miserably, contents of the temp file:
{'root': [{'subject1': {'desc': 'new msg'}}, {'subject2': {'desc': 'msg2'}}]}

expected result:
    root:
         - subject1:
            desc: new msg
         - subject2:
            desc: msg2

Is there anything like yaml.save? Any help greatly appreciated!

Regards,
Tomas
#166 wontfix PyYAML should use libyaml if libyaml available xi sgwong

Reported by sgwong, 4 years ago.

Description

Currently PyYAML only use python implementation although the libyaml available. The following simple changes on __init__.py should do: (I'm not sure whats the use of __with_libyaml__)

__version__ = '3.09'

try:
    from cyaml import *
    __with_libyaml__ = True
    Loader = CLoader
    Dumper = CDumper
except ImportError:
    __with_libyaml__ = False 
#163 fixed PyYAML is not installable with Jython xi olt@…

Reported by olt@…, 4 years ago.

Description

Installing PyYaml? with pip install under Jython doesn't work on a system that has a compiler. It checks for libyaml compatibility and then errors: "Compiling extensions is not supported on Jython"

Solution: Don't add ext_module for platform.system() == Java. See patch.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Note: See TracQuery for help on using queries.