diff options
author | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2006-02-25 20:13:09 +0000 |
---|---|---|
committer | xi <xi@18f92427-320e-0410-9341-c67f048884a3> | 2006-02-25 20:13:09 +0000 |
commit | dc1a5ec85bef86add8a49cddab27d70b8deb552f (patch) | |
tree | 18a758f40ee5ac5ac26413bbbdbab77d7b8cce16 | |
parent | 5142aa8360bc5cb03c18d0a4ea86abcd087d1b6b (diff) | |
download | pyyaml-dc1a5ec85bef86add8a49cddab27d70b8deb552f.tar.gz |
Remove y/n from the boolean constants.
git-svn-id: http://svn.pyyaml.org/branches/pyyaml3000@59 18f92427-320e-0410-9341-c67f048884a3
-rw-r--r-- | MANIFEST.in | 1 | ||||
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | lib/yaml/constructor.py | 2 | ||||
-rw-r--r-- | lib/yaml/resolver.py | 2 | ||||
-rw-r--r-- | setup.py | 4 | ||||
-rw-r--r-- | tests/data/bool.data | 2 | ||||
-rw-r--r-- | tests/data/construct-bool.data | 2 | ||||
-rw-r--r-- | tests/test_constructor.py | 4 | ||||
-rw-r--r-- | tests/test_errors.py | 11 |
9 files changed, 20 insertions, 13 deletions
diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..c41487f --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include README LICENSE @@ -1,5 +1,5 @@ -.PHONY: default build force install test clean +.PHONY: default build force install test dist-src clean PYTHON=/usr/bin/python TEST= @@ -17,6 +17,9 @@ install: build test: build ${PYTHON} tests/test_build.py ${TEST} +dist-src: + ${PYTHON} setup.py sdist --formats=zip,gztar + clean: ${PYTHON} setup.py clean -a diff --git a/lib/yaml/constructor.py b/lib/yaml/constructor.py index 0660f54..1fc3b7d 100644 --- a/lib/yaml/constructor.py +++ b/lib/yaml/constructor.py @@ -161,9 +161,7 @@ class Constructor(BaseConstructor): return None bool_values = { - u'y': True, u'yes': True, - u'n': False, u'no': False, u'true': True, u'false': False, diff --git a/lib/yaml/resolver.py b/lib/yaml/resolver.py index e3706c5..a3c041e 100644 --- a/lib/yaml/resolver.py +++ b/lib/yaml/resolver.py @@ -93,7 +93,7 @@ class Resolver(BaseResolver): Resolver.add_detector( u'tag:yaml.org,2002:bool', - re.compile(ur'''^(?:y|Y|yes|Yes|YES|n|N|no|No|NO + re.compile(ur'''^(?:yes|Yes|YES|n|N|no|No|NO |true|True|TRUE|false|False|FALSE |on|On|ON|off|Off|OFF)$''', re.X), list(u'yYnNtTfFoO')) @@ -1,10 +1,10 @@ NAME = 'PyYAML3000' VERSION = '0.1' -DESCRIPTION = "YAML parser (and emitter)" +DESCRIPTION = "The next generation YAML parser for Python" AUTHOR = "Kirill Simonov" AUTHOR_EMAIL = 'xi@resolvent.net' -LICENSE = "BSD" +LICENSE = "MIT" from distutils.core import setup diff --git a/tests/data/bool.data b/tests/data/bool.data index 3f28955..0988b63 100644 --- a/tests/data/bool.data +++ b/tests/data/bool.data @@ -1,4 +1,4 @@ -- y +- yes - NO - True - on diff --git a/tests/data/construct-bool.data b/tests/data/construct-bool.data index 2a8f2e6..e751222 100644 --- a/tests/data/construct-bool.data +++ b/tests/data/construct-bool.data @@ -1,4 +1,4 @@ -canonical: y +canonical: yes answer: NO logical: True option: on diff --git a/tests/test_constructor.py b/tests/test_constructor.py index e3895fa..794d3e4 100644 --- a/tests/test_constructor.py +++ b/tests/test_constructor.py @@ -4,6 +4,10 @@ try: import datetime except ImportError: pass +try: + set +except NameError: + from sets import Set as set from yaml import * diff --git a/tests/test_errors.py b/tests/test_errors.py index 74ba9f2..626b4e4 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -26,6 +26,7 @@ class TestErrors(test_appliance.TestAppliance): #except ScannerError, exc: #except ParserError, exc: #except ComposerError, exc: + #except ConstructorError, exc: #print '.'*70 #print "%s:" % exc.__class__.__name__, exc raise @@ -39,14 +40,14 @@ class TestErrors(test_appliance.TestAppliance): resolver = Resolver(composer) constructor = Constructor(resolver) return list(constructor) - #except YAMLError, exc: + except YAMLError, exc: #except ScannerError, exc: #except ParserError, exc: #except ComposerError, exc: - except ConstructorError, exc: - print '.'*70 - print "%s:" % filename - print "%s:" % exc.__class__.__name__, exc + #except ConstructorError, exc: + #print '.'*70 + #print "%s:" % filename + #print "%s:" % exc.__class__.__name__, exc raise TestErrors.add_tests('testErrors', '.error-message') |