update PyYAML to 3.09

This commit is contained in:
Ryan Hitchman 2009-11-17 16:13:01 -07:00
parent ddb9bdd3fd
commit 3cab3993dc
5 changed files with 40 additions and 17 deletions

View File

@ -1,28 +1,36 @@
Metadata-Version: 1.0 Metadata-Version: 1.0
Name: PyYAML Name: PyYAML
Version: 3.05 Version: 3.09
Summary: YAML parser and emitter for Python Summary: YAML parser and emitter for Python
Home-page: http://pyyaml.org/wiki/PyYAML Home-page: http://pyyaml.org/wiki/PyYAML
Author: Kirill Simonov Author: Kirill Simonov
Author-email: xi@resolvent.net Author-email: xi@resolvent.net
License: MIT License: MIT
Download-URL: http://pyyaml.org/download/pyyaml/PyYAML-3.05.tar.gz Download-URL: http://pyyaml.org/download/pyyaml/PyYAML-3.09.tar.gz
Description: YAML is a data serialization format designed for human readability and Description: YAML is a data serialization format designed for human readability
interaction with scripting languages. PyYAML is a YAML parser and and interaction with scripting languages. PyYAML is a YAML parser
emitter for Python. and emitter for Python.
PyYAML features a complete YAML 1.1 parser, Unicode support, pickle PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
support, capable extension API, and sensible error messages. PyYAML support, capable extension API, and sensible error messages. PyYAML
supports standard YAML tags and provides Python-specific tags that allow supports standard YAML tags and provides Python-specific tags that
to represent an arbitrary Python object. allow to represent an arbitrary Python object.
PyYAML is applicable for a broad range of tasks from complex PyYAML is applicable for a broad range of tasks from complex
configuration files to object serialization and persistance. configuration files to object serialization and persistance.
Platform: Any Platform: Any
Classifier: Development Status :: 4 - Beta Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.3
Classifier: Programming Language :: Python :: 2.4
Classifier: Programming Language :: Python :: 2.5
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.0
Classifier: Programming Language :: Python :: 3.1
Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Markup Classifier: Topic :: Text Processing :: Markup

View File

@ -2,16 +2,26 @@ PyYAML - The next generation YAML parser and emitter for Python.
To install, type 'python setup.py install'. To install, type 'python setup.py install'.
You may build faster LibYAML based parser and emitter with By default, the setup.py script checks whether LibYAML is installed
'python setup_with_libyaml.py install'. and if so, builds and installs LibYAML bindings. To skip the check
Then you may use the LibYAML based parser this way: and force installation of LibYAML bindings, use the option '--with-libyaml':
'python setup.py --with-libyaml install'. To disable the check and
skip building and installing LibYAML bindings, use '--without-libyaml':
'python setup.py --without-libyaml install'.
When LibYAML bindings are installed, you may use fast LibYAML-based
parser and emitter as follows:
>>> yaml.load(stream, Loader=yaml.CLoader) >>> yaml.load(stream, Loader=yaml.CLoader)
>>> yaml.dump(data, Dumper=yaml.CDumper) >>> yaml.dump(data, Dumper=yaml.CDumper)
PyYAML includes a comprehensive test suite. To run the tests,
type 'python setup.py test'.
For more information, check the PyYAML homepage: For more information, check the PyYAML homepage:
'http://pyyaml.org/wiki/PyYAML'. 'http://pyyaml.org/wiki/PyYAML'.
Documentation (rough and incomplete though): For PyYAML tutorial and reference, see:
'http://pyyaml.org/wiki/PyYAMLDocumentation'. 'http://pyyaml.org/wiki/PyYAMLDocumentation'.
Post your questions and opinions to the YAML-Core mailing list: Post your questions and opinions to the YAML-Core mailing list:
@ -22,3 +32,4 @@ Submit bug reports and feature requests to the PyYAML bug tracker:
PyYAML is written by Kirill Simonov <xi@resolvent.net>. It is released PyYAML is written by Kirill Simonov <xi@resolvent.net>. It is released
under the MIT license. See the file LICENSE for more details. under the MIT license. See the file LICENSE for more details.

View File

@ -8,7 +8,7 @@ from nodes import *
from loader import * from loader import *
from dumper import * from dumper import *
__version__ = '3.08' __version__ = '3.09'
try: try:
from cyaml import * from cyaml import *
@ -43,7 +43,7 @@ def compose(stream, Loader=Loader):
def compose_all(stream, Loader=Loader): def compose_all(stream, Loader=Loader):
""" """
Parse all YAML documents in a stream Parse all YAML documents in a stream
and produce corresponsing representation trees. and produce corresponding representation trees.
""" """
loader = Loader(stream) loader = Loader(stream)
while loader.check_node(): while loader.check_node():

View File

@ -581,7 +581,9 @@ class Emitter(object):
return tag return tag
handle = None handle = None
suffix = tag suffix = tag
for prefix in self.tag_prefixes: prefixes = self.tag_prefixes.keys()
prefixes.sort()
for prefix in prefixes:
if tag.startswith(prefix) \ if tag.startswith(prefix) \
and (prefix == u'!' or len(prefix) < len(tag)): and (prefix == u'!' or len(prefix) < len(tag)):
handle = self.tag_prefixes[prefix] handle = self.tag_prefixes[prefix]
@ -787,7 +789,7 @@ class Emitter(object):
def write_stream_start(self): def write_stream_start(self):
# Write BOM if needed. # Write BOM if needed.
if self.encoding and self.encoding.startswith('utf-16'): if self.encoding and self.encoding.startswith('utf-16'):
self.stream.write(u'\xFF\xFE'.encode(self.encoding)) self.stream.write(u'\uFEFF'.encode(self.encoding))
def write_stream_end(self): def write_stream_end(self):
self.flush_stream() self.flush_stream()
@ -1025,6 +1027,7 @@ class Emitter(object):
else: else:
if ch is None or ch in u' \n\x85\u2028\u2029': if ch is None or ch in u' \n\x85\u2028\u2029':
data = text[start:end] data = text[start:end]
self.column += len(data)
if self.encoding: if self.encoding:
data = data.encode(self.encoding) data = data.encode(self.encoding)
self.stream.write(data) self.stream.write(data)

View File

@ -374,7 +374,8 @@ class Scanner(object):
# Set the current intendation to -1. # Set the current intendation to -1.
self.unwind_indent(-1) self.unwind_indent(-1)
# Reset everything (not really needed). # Reset simple keys.
self.remove_possible_simple_key()
self.allow_simple_key = False self.allow_simple_key = False
self.possible_simple_keys = {} self.possible_simple_keys = {}