| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| | |
|
|/ |
|
|
|
|
| |
Bug: https://github.com/erikrose/blessings/issues/39
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| | |
their escape sequences. Close #47.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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,
|
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| | |
This reverts commit 6d8fe019be1e1c1bd1238980288e1451d99eba80, reversing
changes made to 4cff579fbf395e7cfe3d12cb1b5f53ca535d6673.
|
|\ \ |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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 !
|
| |/
| |
| |
| |
| | |
allow term.color(5)('shmoo') to succeed for terminals where stream is
not a tty.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
- 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
|
| |
|
| |
|
|
|
|
| |
_does_styling is write attribute, does_styling is read-only property
|
| |
|
|
|
|
| |
using tool 'isort', https://github.com/timothycrosley/isort
|
| |
|
| |
|
|
|
|
| |
this makes documentation of these properties more definative, as the 'read-only' attributes that they actually are, removing the "class attributes" documentation headliners.
|
| |
|
|
|
| |
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.
|
|
|
|
|
|
| |
behavior changes. Bump version to 1.5.1.
Remove one test assertion that already occurs almost verbatim in test_formatting_functions_without_tty().
|
| |
|
| |
|
| |
|
|
|
|
| |
hidden_cursor() context manager. Bump version to 1.5.
|
| |
|
|
|
|
| |
moves. Closes #17.
|
| |
|
|
|
|
| |
to stdout. Make sure we can always get a height and width, even on non-tty Terminals.
|
| |
|
|
|
| |
Also have FormattingString stop reaching into the Terminal to pull out `normal`.
|
|
|
|
| |
correct me.
|
| |
|