Skip to content

Commit

Permalink
try this on for size: Drop support for Py26.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikirudennis committed Jul 11, 2016
1 parent bb9b319 commit d1aa498
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ env:
- REQUIREMENTS=true
- REQUIREMENTS=false
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
Expand Down
2 changes: 1 addition & 1 deletion README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ h2. Usage

h3. Notes:

* Active development supports Python 2.6 or later (including Python 3.2+).
* Active development supports Python 2.7 or later (including Python 3.2+).
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def get_version():
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
Expand All @@ -37,7 +36,6 @@ def get_version():
keywords='textile,text,html markup',
install_requires=['six',],
extras_require={
':python_version=="2.6"': ['ordereddict>=1.1'],
'develop': ['regex', 'pytest', 'pytest-cov'],
},
setup_requires=['pytest-runner'],
Expand Down
19 changes: 4 additions & 15 deletions textile/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,10 @@ def generate_tag(tag, content, attributes=None):
# adding text by assigning it to element_tag.text. That results in
# non-ascii text being html-entity encoded. Not bad, but not entirely
# matching php-textile either.
try:
element_tag = [v.decode(enc) for v in ElementTree.tostringlist(element,
encoding=enc, method='html')]
element_tag.insert(len(element_tag) - 1, content)
element_text = ''.join(element_tag)
except AttributeError:
# Python 2.6 doesn't have the tostringlist method, so we have to treat
# it differently.
element_tag = ElementTree.tostring(element, encoding=enc)
element_text = re.sub(r"<\?xml version='1.0' encoding='UTF-8'\?>\n",
'', element_tag)
if content != six.text_type(' /'):
element_text = element_text.rstrip(' />')
element_text = six.text_type('{0}>{1}</{2}>').format(six.text_type(
element_text), content, tag)
element_tag = ElementTree.tostringlist(element, encoding=enc,
method='html')
element_tag.insert(len(element_tag) - 1, content)
element_text = ''.join(element_tag)
return element_text

def has_raw_text(text):
Expand Down

0 comments on commit d1aa498

Please sign in to comment.