diff options
-rwxr-xr-x | bin/test | 4 | ||||
-rw-r--r-- | requirements.txt | 2 | ||||
-rw-r--r-- | screenplain/main.py | 1 | ||||
-rw-r--r-- | screenplain/richstring.py | 1 | ||||
-rw-r--r-- | tests/files_test.py | 3 |
5 files changed, 7 insertions, 4 deletions
@@ -2,7 +2,7 @@ if [[ $(python -V 2>&1) =~ "Python 2" ]] then nosetests --nocapture --with-doctest --doctest-tests -I ^test.py $* && \ - pep8 --ignore=E402 screenplain tests + pycodestyle --ignore=E402,W504 screenplain tests else - python test.py && pep8 --ignore=E402 screenplain tests + python test.py && pycodestyle --ignore=E402,W504 screenplain tests fi diff --git a/requirements.txt b/requirements.txt index 50f908b..97231be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ reportlab unittest2 nose -pep8 +pycodestyle six diff --git a/screenplain/main.py b/screenplain/main.py index 770427c..aaad69c 100644 --- a/screenplain/main.py +++ b/screenplain/main.py @@ -133,5 +133,6 @@ def main(args): if output_file: output.close() + if __name__ == '__main__': main(sys.argv[1:]) diff --git a/screenplain/richstring.py b/screenplain/richstring.py index ad667d1..806787e 100644 --- a/screenplain/richstring.py +++ b/screenplain/richstring.py @@ -225,6 +225,7 @@ class _CreateStyledString(object): def __add__(self, other): return _CreateStyledString(self.styles.union(other.styles)) + plain = _CreateStyledString(()) bold = _CreateStyledString((Bold,)) italic = _CreateStyledString((Italic,)) diff --git a/tests/files_test.py b/tests/files_test.py index b5a390c..4254f55 100644 --- a/tests/files_test.py +++ b/tests/files_test.py @@ -15,7 +15,7 @@ from screenplain.main import main source_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'files')) -line_break_re = re.compile('\s*\n\s*') +line_break_re = re.compile('\\s*\n\\s*') spaces_re = re.compile('[ \t]+') @@ -115,4 +115,5 @@ def _create_tests(): ): FileTests.add_file_case(source, expected) + _create_tests() |