summaryrefslogtreecommitdiff
path: root/blessings
Commit message (Collapse)AuthorAgeFilesLines
* Merge test-running under 3.7 + new set syntax. Close #139.Erik Rose2018-10-241-6/+6
|\
| * Upgrade Python syntax with pyupgrade https://github.com/asottile/pyupgradeHugo2018-10-211-6/+6
| |
* | Python 3 style printHugo2018-10-211-2/+2
|/
* Default to TERM=dumb even if $TERM is set but emptyThomas Deutschmann2018-09-091-1/+1
| | | | Bug: https://github.com/erikrose/blessings/issues/39
* Explicitly catch curses.errorJay Kamat2018-09-011-1/+1
|
* Fix error when TERM is unset or improperly setJay Kamat2018-08-241-2/+7
|
* Recognize correctly the negated form of the capabilities.Andres Ayala2018-08-102-5/+17
| | | | | | | | | | | | | This patch introduces 2 main changes: - COMPOUNDABLES includes the negated version of the 'underline', 'italic'... so now it includes also 'no_italic' and similar. - split_into_formatters considers also the 'no' prefix. With this changes expressions like: t.red_no_underline t.no_italic_bright_yellow work as expected.
* Remove imports from __future__Dave Hunt2018-06-182-3/+0
|
* Import constants from six instead of importing the six moduleDave Hunt2018-06-181-8/+8
|
* Use six to support Python 2 and 3 without using 2to3Dave Hunt2018-06-082-12/+15
|
* Remove redundant code (made redundant by python_requires)Hugo2018-01-151-8/+0
|
* Return 0 from 'number_of_colors' when does_styling is FalseAndrew Halberstadt2017-12-181-0/+3
|
* spelling error, desciptor -> descriptor.Jeff Quast2014-03-191-1/+1
|
* Support terminal types, such as kermit and avatar, that use bytes 127-255 in ↵1.6Erik Rose2013-11-052-7/+13
|\ | | | | | | their escape sequences. Close #47.
| * Tweak comments and update version history.Erik Rose2013-11-051-6/+5
| |
| * encode tparm output as latin1jquast2013-11-042-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as explained in the comments above the decode().encode() wrapper, certain terminal kinds, such as 'avatar' or 'kermit' emit 8-bit bytes that are not legal utf-8 tender. this issue is resolved by encoding these values as latin1, which leaves their values unmolested. This is exaplified by a gist: https://gist.github.com/jquast/5649654 If you don't believe me, try kind='kermit' or kind='avatar', along with t.cup(n, n). Unfortunately, the state of the test cases in the master branch (issue #33) does not allow to add a test case in this branch until that one is pulled to master. Hell, I'll go ahead and make a third (and final) pull request for that one,
* | Remove fallback to 24x80, and fix docstring formatting.Erik Rose2013-11-051-7/+11
| | | | | | There are some advantages to falling back to 24x80: for example, the ability to easily render output based on height and width when being piped through `less`. However, that's a backward incompatible change--we explicitly documented the None return values in earlier versions--so I don't want to make it lightly. Reverting it for now because I want to get the unquestionable parts of this merged in.
* | docfix: 25 x 80 -> 24 x 80jquast2013-11-051-1/+1
| |
* | Revert "Merge remote-tracking branch 'origin/bugfix-3' into bugfix-1"jquast2013-11-042-27/+24
| | | | | | | | | | This reverts commit 6d8fe019be1e1c1bd1238980288e1451d99eba80, reversing changes made to 4cff579fbf395e7cfe3d12cb1b5f53ca535d6673.
* | Merge remote-tracking branch 'origin/bugfix-3' into bugfix-1jquast2013-11-042-24/+27
|\ \
| * | only perform color lookup for colored terminalsjquast2013-11-042-12/+14
| | |
| * | resolve any 'must call (at least) setupterm() first' errorsjquast2013-11-041-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | avoid calling tparm when self.does_styling is False, which resolves issues with attempting to use things (such as nosetests progressive) where the terminal is not a tty. its also a "pokemon exception" and is emitted for a good reason, we certainly should not be calling tparm without calling setupterm() first !
| * | turtles all the way down for NullCallableString()jquast2013-11-041-1/+6
| |/ | | | | | | | | allow term.color(5)('shmoo') to succeed for terminals where stream is not a tty.
* | implement height and width fallback for non-ttyjquast2013-11-041-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | once the height and width test is resolved to actually test, we notice that running `nosetests 2>&1 | less' & etc. will fail: the ioctl for TIOCGWINSZ fails for non-ttys (such as used by travis CI). So, we fall-through to the LINES, COLUMNS environment variables, with default values of (24, 80). (24, 80) has been a fairly standard screensize for IBM PC-DOS and Apple ][ (beginning with the 80-column character card), and C128. It is also the default for xterm, and many classic terminals (such as a vt220) or emulating terminals (such as telix), or bulletin board servers (such as teleguard) where a 'status line' is also present. In reality, these screens are capable of *25* lines, but the 25th line is reserved for the status line. Irregardless, non-zero must be returned for 'height' and 'width' properties, as a value of 0 may become a "divide by zero" error for mathematical operations that make use of the terminal height or width in scripts that the user may chose to pipe to 'less -r' or some such. In these situations, even though a value is returned, operations such as 'move(x, y)' would still become 'stripped' due to 'is_a_tty' becoming False, so there is no actual harm in providing a terminal size that is not legal.
* | fix testing height and width for integerjquast2013-11-041-3/+3
|/
* Add a docstring so Blessings looks better in the REPL's help().Erik Rose2013-09-091-0/+3
|
* Merge the property-ization of is_a_tty and does_styling, some PEP-8 fixes, ↵Erik Rose2013-09-091-22/+32
|\ | | | | | | and the removal of some unused imports. Close #37.
| * Fix some spelling and grammar.Erik Rose2013-09-091-4/+4
| |
| * rollback undesired changes per feedbackjquast2013-09-091-14/+13
| | | | | | | | | | | | | | | | | | - remove module-level docstring (but? pep-257, "All modules should normally have docstrings" ??) - try to restore original import ordering (unused imports remain removed) - restore deep import of os environ, isatty - restore "caching doesn't work" scrap code
| * is_a_tty property assignment fix -> _is_a_ttyjquast2013-09-071-1/+1
| |
| * pep8, remove old "cache wanted" codefartjquast2013-09-071-8/+5
| |
| * more merge fixes for does_styling property-reworkjquast2013-09-071-1/+1
| | | | | | | | _does_styling is write attribute, does_styling is read-only property
| * remove git-merge junk, CVS merges have been easierjquast2013-09-071-7/+0
| |
| * import sortingjquast2013-09-071-7/+13
| | | | | | | | using tool 'isort', https://github.com/timothycrosley/isort
| * 'os' imported but unusedjquast2013-09-071-2/+8
| |
| * 'defaultdict' imported but unusedjquast2013-09-071-1/+0
| |
| * refactor is_a_tty and does_styling as propertiesjquast2013-09-071-14/+24
| | | | | | | | this makes documentation of these properties more definative, as the 'read-only' attributes that they actually are, removing the "class attributes" documentation headliners.
* | Make test docstrings PEP-8-compliant.Erik Rose2013-09-091-6/+12
|/
* Make PEP-8-compliant.Erik Rose2013-08-311-17/+36
|
* Make does_styling attr public. Bump version to 1.6.Erik Rose2013-08-301-6/+10
| | | This is more often what's intended when is_a_tty is examined. While a caller could keep track of what he's passed to the Terminal constructor, it is often more convenient to have the info available directly on the instance, which we're already passing around everywhere.
* Replace the weird clear() test with what was originally intended. This one ↵1.5.1Erik Rose2013-08-301-6/+1
| | | | actually fails before the #31 fix.
* Explain the new behavior to myself. Remove 1 test assertion. No non-test ↵Erik Rose2013-08-302-12/+43
| | | | | | behavior changes. Bump version to 1.5.1. Remove one test assertion that already occurs almost verbatim in test_formatting_functions_without_tty().
* Add testcase for NullCallableStringVitja Makarov2013-08-261-0/+9
|
* Fix NullCallableString() when called with no or multiple argumentsVitja Makarov2013-08-241-3/+5
|
* contextmanagers: Put state restore code into finally blockVitja Makarov2013-07-301-8/+13
|
* Provide a decent way to say "don't style". Closes #18.Erik Rose2012-06-162-1/+11
|
* Sugar full-screen capabilities. Make location() context manager slimmer. Add ↵Erik Rose2012-06-081-22/+30
| | | | hidden_cursor() context manager. Bump version to 1.5.
* Fix a bug where location() wouldn't do anything when passed 0s.Erik Rose2012-06-012-3/+13
|
* Document an idiom for restoring the cursor location after a series of manual ↵Erik Rose2012-02-012-1/+13
| | | | moves. Closes #17.
* Sugar cursor-visibility and single-space-movement capabilities. Closes #15.Erik Rose2011-12-191-4/+11
|