Sfoglia il codice sorgente

Bump version to 0.4.dev and add support for Python 3.2.

tags/v0.3.2
Ben Kurtovic 11 anni fa
parent
commit
37003d2ed1
9 ha cambiato i file con 28 aggiunte e 11 eliminazioni
  1. +1
    -0
      .travis.yml
  2. +4
    -0
      CHANGELOG
  3. +8
    -0
      docs/changelog.rst
  4. +1
    -1
      mwparserfromhell/__init__.py
  5. +2
    -1
      mwparserfromhell/compat.py
  6. +4
    -4
      mwparserfromhell/string_mixin.py
  7. +1
    -0
      setup.py
  8. +6
    -4
      tests/test_string_mixin.py
  9. +1
    -1
      tests/tokenizer/tags.mwtest

+ 1
- 0
.travis.yml Vedi File

@@ -1,6 +1,7 @@
language: python
python:
- "2.7"
- "3.2"
- "3.3"
install: python setup.py build
script: python setup.py test -q

+ 4
- 0
CHANGELOG Vedi File

@@ -1,3 +1,7 @@
v0.4 (unreleased):

- Added support for Python 3.2 (along with current support for 3.3 and 2.7).

v0.3.1 (released August 29, 2013):

- Fixed a parser bug involving URLs nested inside other markup.


+ 8
- 0
docs/changelog.rst Vedi File

@@ -1,6 +1,14 @@
Changelog
=========

v0.4
----

Unreleased
(`changes <https://github.com/earwig/mwparserfromhell/compare/v0.3.1...develop>`__):

- Added support for Python 3.2 (along with current support for 3.3 and 2.7).

v0.3.1
------



+ 1
- 1
mwparserfromhell/__init__.py Vedi File

@@ -31,7 +31,7 @@ from __future__ import unicode_literals
__author__ = "Ben Kurtovic"
__copyright__ = "Copyright (C) 2012, 2013 Ben Kurtovic"
__license__ = "MIT License"
__version__ = "0.3.1"
__version__ = "0.4.dev"
__email__ = "ben.kurtovic@verizon.net"

from . import (compat, definitions, nodes, parser, smart_list, string_mixin,


+ 2
- 1
mwparserfromhell/compat.py Vedi File

@@ -10,7 +10,8 @@ types are meant to be imported directly from within the parser's modules.

import sys

py3k = sys.version_info[0] == 3
py3k = sys.version_info.major == 3
py32 = py3k and sys.version_info.minor == 2

if py3k:
bytes = bytes


+ 4
- 4
mwparserfromhell/string_mixin.py Vedi File

@@ -27,7 +27,7 @@ interface for the ``unicode`` type (``str`` on py3k) in a dynamic manner.

from __future__ import unicode_literals

from .compat import py3k, str
from .compat import py3k, py32, str

__all__ = ["StringMixIn"]

@@ -125,7 +125,7 @@ class StringMixIn(object):
def capitalize(self):
return self.__unicode__().capitalize()

if py3k:
if py3k and not py32:
@inheritdoc
def casefold(self):
return self.__unicode__().casefold()
@@ -288,7 +288,7 @@ class StringMixIn(object):
def rpartition(self, sep):
return self.__unicode__().rpartition(sep)

if py3k:
if py3k and not py32:
@inheritdoc
def rsplit(self, sep=None, maxsplit=None):
kwargs = {}
@@ -310,7 +310,7 @@ class StringMixIn(object):
def rstrip(self, chars=None):
return self.__unicode__().rstrip(chars)

if py3k:
if py3k and not py32:
@inheritdoc
def split(self, sep=None, maxsplit=None):
kwargs = {}


+ 1
- 0
setup.py Vedi File

@@ -54,6 +54,7 @@ setup(
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Topic :: Text Processing :: Markup"
],


+ 6
- 4
tests/test_string_mixin.py Vedi File

@@ -25,7 +25,7 @@ from sys import getdefaultencoding
from types import GeneratorType
import unittest

from mwparserfromhell.compat import bytes, py3k, str
from mwparserfromhell.compat import bytes, py3k, py32, str
from mwparserfromhell.string_mixin import StringMixIn

from .compat import range
@@ -52,8 +52,10 @@ class TestStringMixIn(unittest.TestCase):
"rsplit", "rstrip", "split", "splitlines", "startswith", "strip",
"swapcase", "title", "translate", "upper", "zfill"]
if py3k:
methods.extend(["casefold", "format_map", "isidentifier",
"isprintable", "maketrans"])
if not py32:
methods.append("casefold")
methods.extend(["format_map", "isidentifier", "isprintable",
"maketrans"])
else:
methods.append("decode")
for meth in methods:
@@ -325,7 +327,7 @@ class TestStringMixIn(unittest.TestCase):
self.assertEqual("", str15.lower())
self.assertEqual("foobar", str16.lower())
self.assertEqual("ß", str22.lower())
if py3k:
if py3k and not py32:
self.assertEqual("", str15.casefold())
self.assertEqual("foobar", str16.casefold())
self.assertEqual("ss", str22.casefold())


+ 1
- 1
tests/tokenizer/tags.mwtest Vedi File

@@ -470,7 +470,7 @@ output: [TemplateOpen(), Text(text="t1"), TemplateClose(), TagOpenOpen(), Text(t
name: unparsable_attributed
label: a tag that should not be put through the normal parser; parsed attributes
input: "{{t1}}<nowiki attr=val attr2="{{val2}}">{{t2}}</nowiki>{{t3}}"
output: [TemplateOpen(), Text(text=u't1'), TemplateClose(), TagOpenOpen(), Text(text="nowiki"), TagAttrStart(pad_first=" ", pad_before_eq="", pad_after_eq=""), Text(text="attr"), TagAttrEquals(), Text(text="val"), TagAttrStart(pad_first=" ", pad_before_eq="", pad_after_eq=""), Text(text="attr2"), TagAttrEquals(), TagAttrQuote(), TemplateOpen(), Text(text="val2"), TemplateClose(), TagCloseOpen(padding=""), Text(text="{{t2}}"), TagOpenClose(), Text(text="nowiki"), TagCloseClose(), TemplateOpen(), Text(text="t3"), TemplateClose()]
output: [TemplateOpen(), Text(text="t1"), TemplateClose(), TagOpenOpen(), Text(text="nowiki"), TagAttrStart(pad_first=" ", pad_before_eq="", pad_after_eq=""), Text(text="attr"), TagAttrEquals(), Text(text="val"), TagAttrStart(pad_first=" ", pad_before_eq="", pad_after_eq=""), Text(text="attr2"), TagAttrEquals(), TagAttrQuote(), TemplateOpen(), Text(text="val2"), TemplateClose(), TagCloseOpen(padding=""), Text(text="{{t2}}"), TagOpenClose(), Text(text="nowiki"), TagCloseClose(), TemplateOpen(), Text(text="t3"), TemplateClose()]

---



Caricamento…
Annulla
Salva