forked from erikrose/blessings
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix for term.split_seqs('term.right(3)')
In version 1.18.0 and earlier, >> term.split_seqs(term.move_right(333) + 'xyz', maxsplit=1) ['\x1b[333C', '333', 'xyz'] This is a bug, it duplicates the matched parameter, this is now corrected: ['\x1b[3C', 'xyz'] Previously, we documented "same arguments as "re.split", so we must also implement maxsplit and flags. Also, - fix flake8 linting of tests by moving fixtures to conftest.py, fixes "unused" or "re-definition from import" errors. - version stamp blessed/__init__.py like a codegen step i guess - remove run_codecov.py, its been fixed upstream codecov/codecov-python#158 (comment)
- Loading branch information
Showing
15 changed files
with
142 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# std imports | ||
import os | ||
|
||
# 3rd party | ||
import pytest | ||
|
||
all_terms_params = 'xterm screen ansi vt220 rxvt cons25 linux'.split() | ||
many_lines_params = [40, 80] | ||
# we must test a '1' column for conditional in _handle_long_word | ||
many_columns_params = [1, 10] | ||
|
||
if os.environ.get('TEST_QUICK'): | ||
many_lines_params = [80, ] | ||
many_columns_params = [25, ] | ||
|
||
|
||
@pytest.fixture(params=all_terms_params) | ||
def all_terms(request): | ||
"""Common kind values for all kinds of terminals.""" | ||
return request.param | ||
|
||
|
||
@pytest.fixture(params=many_lines_params) | ||
def many_lines(request): | ||
"""Various number of lines for screen height.""" | ||
return request.param | ||
|
||
|
||
@pytest.fixture(params=many_columns_params) | ||
def many_columns(request): | ||
"""Various number of columns for screen width.""" | ||
return request.param |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version": "1.18.0"} | ||
{"version": "1.18.1"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python3 | ||
# std imports | ||
import os | ||
import re | ||
import json | ||
|
||
|
||
def main(): | ||
# I don't know why, we maintain __version__ in blessed, because that's | ||
# how it was done a long time ago before pip, anyway we do basic | ||
# code generation, version.json -> __init__.py | ||
fpath_json = os.path.join(os.path.dirname(__file__), 'version.json') | ||
version = json.load(open(fpath_json, 'r'))['version'] | ||
fpath_py = os.path.join(os.path.dirname(__file__), 'blessed', '__init__.py') | ||
prev_text = open(fpath_py, 'r').read() | ||
next_text = re.sub(r"(__version__ = )(.*)$", r'\1"{0}"'.format(version), | ||
prev_text, flags=re.MULTILINE) | ||
if prev_text != next_text: | ||
print('Updating blessed.__version__ to {}'.format(version)) | ||
open(fpath_py, 'w').write(next_text) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |