From 3cab3993dc23dfdf9bb9fe5058c2572fa558be48 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Tue, 17 Nov 2009 16:13:01 -0700 Subject: [PATCH] update PyYAML to 3.09 --- plugins/util/yaml/PKG-INFO | 24 ++++++++++++++++-------- plugins/util/yaml/README | 19 +++++++++++++++---- plugins/util/yaml/__init__.py | 4 ++-- plugins/util/yaml/emitter.py | 7 +++++-- plugins/util/yaml/scanner.py | 3 ++- 5 files changed, 40 insertions(+), 17 deletions(-) diff --git a/plugins/util/yaml/PKG-INFO b/plugins/util/yaml/PKG-INFO index fb2dd02..eb63484 100644 --- a/plugins/util/yaml/PKG-INFO +++ b/plugins/util/yaml/PKG-INFO @@ -1,28 +1,36 @@ Metadata-Version: 1.0 Name: PyYAML -Version: 3.05 +Version: 3.09 Summary: YAML parser and emitter for Python Home-page: http://pyyaml.org/wiki/PyYAML Author: Kirill Simonov Author-email: xi@resolvent.net License: MIT -Download-URL: http://pyyaml.org/download/pyyaml/PyYAML-3.05.tar.gz -Description: YAML is a data serialization format designed for human readability and - interaction with scripting languages. PyYAML is a YAML parser and - emitter for Python. +Download-URL: http://pyyaml.org/download/pyyaml/PyYAML-3.09.tar.gz +Description: YAML is a data serialization format designed for human readability + and interaction with scripting languages. PyYAML is a YAML parser + and emitter for Python. PyYAML features a complete YAML 1.1 parser, Unicode support, pickle support, capable extension API, and sensible error messages. PyYAML - supports standard YAML tags and provides Python-specific tags that allow - to represent an arbitrary Python object. + supports standard YAML tags and provides Python-specific tags that + allow to represent an arbitrary Python object. PyYAML is applicable for a broad range of tasks from complex configuration files to object serialization and persistance. Platform: Any -Classifier: Development Status :: 4 - Beta +Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent 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 :: Text Processing :: Markup diff --git a/plugins/util/yaml/README b/plugins/util/yaml/README index 9687f87..c1edf13 100644 --- a/plugins/util/yaml/README +++ b/plugins/util/yaml/README @@ -2,16 +2,26 @@ PyYAML - The next generation YAML parser and emitter for Python. To install, type 'python setup.py install'. -You may build faster LibYAML based parser and emitter with -'python setup_with_libyaml.py install'. -Then you may use the LibYAML based parser this way: +By default, the setup.py script checks whether LibYAML is installed +and if so, builds and installs LibYAML bindings. To skip the check +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.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: 'http://pyyaml.org/wiki/PyYAML'. -Documentation (rough and incomplete though): +For PyYAML tutorial and reference, see: 'http://pyyaml.org/wiki/PyYAMLDocumentation'. 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 . It is released under the MIT license. See the file LICENSE for more details. + diff --git a/plugins/util/yaml/__init__.py b/plugins/util/yaml/__init__.py index 69c18c4..c0fd1f3 100644 --- a/plugins/util/yaml/__init__.py +++ b/plugins/util/yaml/__init__.py @@ -8,7 +8,7 @@ from nodes import * from loader import * from dumper import * -__version__ = '3.08' +__version__ = '3.09' try: from cyaml import * @@ -43,7 +43,7 @@ def compose(stream, Loader=Loader): def compose_all(stream, Loader=Loader): """ Parse all YAML documents in a stream - and produce corresponsing representation trees. + and produce corresponding representation trees. """ loader = Loader(stream) while loader.check_node(): diff --git a/plugins/util/yaml/emitter.py b/plugins/util/yaml/emitter.py index 0932942..4cb2c8a 100644 --- a/plugins/util/yaml/emitter.py +++ b/plugins/util/yaml/emitter.py @@ -581,7 +581,9 @@ class Emitter(object): return tag handle = None suffix = tag - for prefix in self.tag_prefixes: + prefixes = self.tag_prefixes.keys() + prefixes.sort() + for prefix in prefixes: if tag.startswith(prefix) \ and (prefix == u'!' or len(prefix) < len(tag)): handle = self.tag_prefixes[prefix] @@ -787,7 +789,7 @@ class Emitter(object): def write_stream_start(self): # Write BOM if needed. 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): self.flush_stream() @@ -1025,6 +1027,7 @@ class Emitter(object): else: if ch is None or ch in u' \n\x85\u2028\u2029': data = text[start:end] + self.column += len(data) if self.encoding: data = data.encode(self.encoding) self.stream.write(data) diff --git a/plugins/util/yaml/scanner.py b/plugins/util/yaml/scanner.py index 8bccdc3..5228fad 100644 --- a/plugins/util/yaml/scanner.py +++ b/plugins/util/yaml/scanner.py @@ -374,7 +374,8 @@ class Scanner(object): # Set the current intendation to -1. self.unwind_indent(-1) - # Reset everything (not really needed). + # Reset simple keys. + self.remove_possible_simple_key() self.allow_simple_key = False self.possible_simple_keys = {}