Skip to content

Commit

Permalink
small change to make BeautifulSoup4 element instances work ok with v
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaymon committed Dec 12, 2016
1 parent 0488d0c commit 233c5ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
4 changes: 2 additions & 2 deletions pout.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# pout2.b("remember to remove pout2")
# except ImportError: pass

__version__ = '0.6.2'
__version__ = '0.6.3'


logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -337,7 +337,7 @@ def _add_indent(self, val, indent_count):
# return s.fill(val)

s = val.split('\n')
s = [(u"\t" * indent_count) + line for line in s]
s = [(u"\t" * indent_count) + self._get_unicode(line) for line in s]
s = u"\n".join(s)
return s

Expand Down
18 changes: 5 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,13 @@
# http://docs.python.org/distutils/setupscript.html
# http://docs.python.org/2/distutils/examples.html

import sys
from setuptools import setup
import ast
import re
import os

name = 'pout'
version = ''
with open('{}.py'.format(name), 'rU') as f:
for node in (n for n in ast.parse(f.read()).body if isinstance(n, ast.Assign)):
node_name = node.targets[0]
if isinstance(node_name, ast.Name) and node_name.id.startswith('__version__'):
version = node.value.s
break

if not version:
raise RuntimeError('Unable to find version number')
name = "pout"
with open(os.path.join("{}.py".format(name))) as f:
version = re.search("^__version__\s*=\s*[\'\"]([^\'\"]+)", f.read(), flags=re.I | re.M).group(1)

setup(
name=name,
Expand Down

0 comments on commit 233c5ba

Please sign in to comment.