Commit graph

720 commits

Author SHA1 Message Date
oefe
f8b536ca06 Fix missing mode property on file wrapper
Without this property, uploads using `requests` fails to set the
Content-Length header, and falls back to chunked encoding,
which many hosts (e.g. S3) don't support.
2022-08-27 17:08:29 +02:00
Will McGugan
e2716d3cd0
Merge pull request #2491 from multimeric/max-depth-install
Add max_depth arg to install()
2022-08-26 11:31:00 +01:00
Michael Milton
13506c2367 Add max_depth arg to install() 2022-08-26 01:53:54 +10:00
Michael Milton
fc13d7c19e Add delimiters to elided pretty prints 2022-08-25 15:36:16 +10:00
darrenburns
0425c792c1
Parse escape codes in Pretty repr (#2470)
* Parse ANSI escape codes in pretty reprs

* Fix mypy issue

* Test parse escape codes in Pretty repr

* Add CHANGELOG entry for parsing escape codes in Pretty reprs

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2022-08-17 15:32:56 +01:00
Darren Burns
f417474dc1
Add test for force color 2022-08-05 15:37:25 +01:00
Darren Burns
c94d53e532 Fix some tests on 3.11 2022-07-14 16:48:46 +01:00
Darren Burns
878632c354 Fix test_inspect_text to support Python 3.11 2022-07-14 15:30:52 +01:00
Will McGugan
76dfb9654b optimized divide 2022-07-11 12:49:56 +01:00
Will McGugan
b1368b61a4
Merge pull request #2301 from tomers/iso8601-highlighter
Add Iso8601Highlighter
2022-07-11 11:46:37 +01:00
Olivier Philippon
8e2da1afab
Merge pull request #2366 from Textualize/investigate-rich-within-jupyter
[jupyter] bypass the pretty-rendering of some specific graphics-related classes
2022-07-06 09:36:56 +01:00
Olivier Philippon
36ffdcf7bd [_inspect] Add docstrings to our generic functions that determine the type of an object 2022-07-05 15:18:50 +01:00
Olivier Philippon
8b17bc61f8 [_inspect] Add generic functions to determine the type of an object
We use these functions to prevent some classes from being displayed in Jupyter notebooks, using their fully qualified names
2022-07-01 12:36:06 +01:00
Olivier Philippon
6fb7d4b856 [jupyter] bypass the pretty-rendering of some specific graphics-related classes
Matplotlib "Artists", for example, manage their own rendering in a Jupyter notebook, and we should not try to render them too.
2022-06-28 15:22:17 +01:00
Will McGugan
d4225f37bf
Merge pull request #2341 from Textualize/add-highlight-range-support-to-syntax
[syntax] add a `stylize_ranges` method to the Syntax class
2022-06-28 14:35:18 +01:00
Olivier Philippon
6e634705b7 [syntax] silently clamp the column index of stylised ranges to the maximum possible value 2022-06-24 16:01:29 +01:00
zephyrkul
a1a880c832
Add test 2022-06-21 15:22:00 -06:00
Olivier Philippon
8e58adcab0 [syntax] address PR feedback for stylized ranges 2022-06-21 11:46:43 +01:00
Will McGugan
fc4af2752a
Merge pull request #2332 from AntonyMilneQB/master
Allow Jupyter to vary width/height using COLUMNS/LINES
2022-06-20 11:50:02 +01:00
Will McGugan
d4e55f7629 imports 2022-06-20 11:19:45 +01:00
Olivier Philippon
0b3379f528 [syntax] better API and performance for stylized ranges 2022-06-17 16:31:26 +01:00
Will McGugan
19e518fc92
Merge branch 'master' into capture-bugfix 2022-06-17 11:40:42 +01:00
Will McGugan
7dea1e7fa6
Merge pull request #2342 from Textualize/rule-rich-measure
Rule rich measure
2022-06-17 11:12:08 +01:00
Will McGugan
7cc021d47c new lru cache implementation 2022-06-17 10:46:23 +01:00
Olivier Philippon
75315fabc5 [syntax] improve performance for stylize_ranges() 2022-06-16 16:38:36 +01:00
Darren Burns
3c1159d2e8
Ensure the correct stuff is written to stdout when recording and capturing 2022-06-16 10:27:05 +01:00
Darren Burns
051dd0452c
Fix interaction between Console capture and record 2022-06-15 17:07:04 +01:00
Olivier Philippon
ebc5d2797e [syntax] add a highlight_ranges optional arg to the Syntax ctor
With this new API we can apply a style from (LINE A, COLUMN A) to (LINE B, COLUMN B) - which is something we will need to be able to add arbitrary ranges to Syntax
2022-06-15 15:30:41 +01:00
Darren Burns
b5c1d650e6
Merge branch 'master' of github.com:Textualize/rich into rule-rich-measure 2022-06-15 14:59:22 +01:00
Darren Burns
dbb27d30a7
Fix hang when Rule title greater than required space 2022-06-15 14:49:15 +01:00
Olivier Philippon
a7124ea10c [win32] Use initial cursor size when hiding or showing it
By doing this the users get their original cursor style back when Rich gives control back to the terminal, rather than a "full size" one
2022-06-15 08:37:38 +01:00
Tomer Shalev
8443505e21
Merge branch 'master' into iso8601-highlighter 2022-06-14 15:03:00 +03:00
Tomer Shalev
2707a73435 Add Iso8601Highlighter
Add ability to highlight date and time strings according to ISO8601 [1]

[1] https://en.wikipedia.org/wiki/ISO_8601
2022-06-14 15:02:35 +03:00
Will McGugan
7870603929
Merge pull request #2254 from althonos/master
Forward the internal handle name wrapped in `rich.progress._Reader`
2022-06-14 09:18:32 +01:00
Antony Milne
d4f9f6dc50 Update column width, CHANGELOG, CONTRIBUTORS 2022-06-09 23:07:28 +01:00
Antony Milne
da10ca92fc Add JUPYTER_COLUMNS/JUPYTER_LINES and tests 2022-06-09 22:52:37 +01:00
darrenburns
51889e2e66
Substituting plain headed box when show_header=False on Table (#2330)
* Substituting plain headed box when show_header=False on Table

* Update changelog

* Revert __main__ in table to remove test code
2022-06-08 16:22:30 +01:00
Will McGugan
e8a9466b94 test fix 2022-06-05 16:04:51 +01:00
Will McGugan
e3bd037791
Merge branch 'master' into text-wrapping-edgecase 2022-05-27 16:14:39 +01:00
Olivier Philippon
25d0c0e898 [inspect] Address PR feedback on ASCII special characters' replacement with their escaped version 2022-05-27 14:56:55 +01:00
Olivier Philippon
236096ea8f [inspect] Replace ASCII special characters with their "non-special" readable version
With this we allow the following:
- Such characters will be displayed in the data returned by "rich.inspect" when they are used in docstrings
- We fix the crash that can happen in some circumstances in the `Text.divide()` method when some docstrings have such special characters
2022-05-27 14:56:55 +01:00
Olivier Philippon
78a0229467 [inspect] Replace ASCII special characters with their "non-special" readable version in docstrings
With this we allow the following:
- Such characters will be displayed in the data returned by "rich.inspect"
- We fix the crash that can happen in some circumstances in the `Text.divide()` method when some docstrings have such special characters
2022-05-27 14:56:02 +01:00
Darren Burns
0dc3985ea8
Fix wrapping issue 2022-05-25 16:25:10 +01:00
Darren Burns
ca474c37af
Update test 2022-05-25 13:43:47 +01:00
Darren Burns
34a0c50421
Add some CJK wrapping test cases 2022-05-25 12:59:45 +01:00
Darren Burns
f70414a783
Remove duplicate test 2022-05-25 12:50:06 +01:00
Darren Burns
ee60bc13ba
Fix text wrapping edge case 2022-05-25 12:43:48 +01:00
Darren Burns
9174059949
Add xfail test for text wrapping issue 2022-05-25 10:36:36 +01:00
Darren Burns
44d32b2b4a
Add test to catch wrapping edgecase 2022-05-24 17:18:54 +01:00
Darren Burns
7e96597f65
Rename test 2022-05-24 17:06:24 +01:00