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
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

View File

@ -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 <xi@resolvent.net>. It is released
under the MIT license. See the file LICENSE for more details.

View File

@ -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():

View File

@ -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)

View File

@ -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 = {}