From 295428bc16093f15b62f8d51ceb4fd673c522175 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Wed, 23 Mar 2022 10:15:45 +0000 Subject: [PATCH 01/18] wrong version number --- CHANGELOG.md | 8 +++++++- src/rich_cli/__main__.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a2efb2..20de36a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.6.0] 2022-04-23 +## [1.6.1] - 2022-04-23 + +### Fixed + +- Fixed wrong version number reported + +## [1.6.0] - 2022-04-23 ### Added diff --git a/src/rich_cli/__main__.py b/src/rich_cli/__main__.py index 4b36058..83b8f6b 100644 --- a/src/rich_cli/__main__.py +++ b/src/rich_cli/__main__.py @@ -37,7 +37,7 @@ "toml": "toml", } -VERSION = "1.5.1" +VERSION = "1.6.1" AUTO = 0 From 46f845bf125bbb684d68468176ec18da06847290 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Wed, 23 Mar 2022 10:16:19 +0000 Subject: [PATCH 02/18] version bump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d851180..5271c4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "rich-cli" homepage = "https://github.com/Textualize/rich-cli" -version = "1.6.0" +version = "1.6.1" description = "Command Line Interface to Rich" authors = ["Will McGugan "] license = "MIT" From 4f27fa4cdf149b1d112e98bceb86da4c4eab28bb Mon Sep 17 00:00:00 2001 From: Dustin Rodrigues Date: Thu, 10 Mar 2022 12:33:39 -0500 Subject: [PATCH 03/18] update homebrew installation instructions --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index eb01a3a..041889f 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ pipx install rich-cli You can install Rich-CLI with [Homebew](https://brew.sh/). ``` -brew tap textualize/rich brew install rich ``` From 8c3103303db2a528dbf6de318647ebf380fc5a1b Mon Sep 17 00:00:00 2001 From: Vincent Perrollaz Date: Sun, 3 Apr 2022 20:41:45 +0200 Subject: [PATCH 04/18] Add the some vi-style navigation to the pager. Precisely: j, k, ctrl-d, ctrl-u. --- README.md | 4 ++-- src/rich_cli/pager.py | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 135cf7a..b06fde7 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ brew install rich Rich-CLI may be installed as a Python package. -ℹ️ It is reccomended to create a *virtual environment* first, to avoid any dependency conflicts. +ℹ️ It is reccomended to create a _virtual environment_ first, to avoid any dependency conflicts. ``` python -m pip install rich-cli @@ -132,7 +132,7 @@ rich "Hello [b]World[/b]!" --rule --rule-style "red" --rule-char "=" Add `--pager` to display the content with a built in pager application. -Scroll the pager with cursor keys, page up/down, home, end. Alternatively use the scrollbar which will be visible to the right of the terminal. +Scroll the pager with cursor keys, page up/down, home, end. Alternatively use the scrollbar which will be visible to the right of the terminal. Or use the vi navigation (j, k, ctrl_d, ctrl-u). ``` rich __main__.py -n -g --theme monokai --pager diff --git a/src/rich_cli/pager.py b/src/rich_cli/pager.py index 53d4ce3..419d3a0 100644 --- a/src/rich_cli/pager.py +++ b/src/rich_cli/pager.py @@ -59,8 +59,18 @@ async def on_load(self, event: events.Load) -> None: await self.bind("q", "quit", "Quit") async def on_key(self, event: events.Key) -> None: - if event.key == " ": + if event.key == "j": + self.body.scroll_up() + elif event.key == "k": + self.body.scroll_down() + elif event.key == " ": self.body.page_down() + elif event.key == "ctrl+u": + self.body.target_y -= self.body.size.height // 2 + self.body.animate("y", self.body.target_y, easing="out_cubic") + elif event.key == "ctrl+d": + self.body.target_y += self.body.size.height // 2 + self.body.animate("y", self.body.target_y, easing="out_cubic") async def on_mount(self, event: events.Mount) -> None: self.body = body = ScrollView(auto_width=True) From 1301c3311678f9f3bd0253035972b9fd20f05eef Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sun, 17 Apr 2022 17:08:58 +0100 Subject: [PATCH 05/18] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 135cf7a..c3c1c88 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ pipx install rich-cli ### MacOS -You can install Rich-CLI with [Homebew](https://brew.sh/). +You can install Rich-CLI with [Homebrew](https://brew.sh/). ``` brew install rich From 2c810dd36c7f9fa9926b187f59d34c3d0ac59476 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sun, 17 Apr 2022 19:47:58 +0100 Subject: [PATCH 06/18] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index c3c1c88..5533049 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,6 @@ brew install rich Rich-CLI may be installed as a Python package. -ℹ️ It is reccomended to create a *virtual environment* first, to avoid any dependency conflicts. - ``` python -m pip install rich-cli ``` From 9bc9c4b56cae0ab5e0a81b889bb6afb4fc363f75 Mon Sep 17 00:00:00 2001 From: David Brochart Date: Mon, 18 Apr 2022 16:36:41 +0200 Subject: [PATCH 07/18] Add Jupyter notebook renderer --- README.md | 11 ++++ src/rich_cli/__main__.py | 114 ++++++++++++++++++++++++++++++++++ test_data/notebook.ipynb | 131 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 256 insertions(+) create mode 100644 test_data/notebook.ipynb diff --git a/README.md b/README.md index 5533049..98efe90 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,17 @@ If your terminal supports hyperlinks, you can add `--hyperlinks` or `-y` which w rich README.md --hyperlinks ``` +## Jupyter notebook + +You can request Jupyter notebook rendering by adding the `--ipynb` switch. If the file ends with `.ipynb` Jupyter notebook will be auto-detected. + +``` +rich notebook.ipynb +``` + +All options that apply to syntax highlighting can be applied to code cells, and all options that apply to Markdown can be +applied to Markdown cells. + ## JSON You can request JSON pretty formatting and highlighting with the `--json` or `-j` switches. If the file ends with `.json` then JSON will be auto-detected. diff --git a/src/rich_cli/__main__.py b/src/rich_cli/__main__.py index 83b8f6b..a19c954 100644 --- a/src/rich_cli/__main__.py +++ b/src/rich_cli/__main__.py @@ -49,6 +49,7 @@ RULE = 6 INSPECT = 7 CSV = 8 +IPYNB = 9 def on_error(message: str, error: Optional[Exception] = None, code=-1) -> NoReturn: @@ -250,6 +251,7 @@ class OptionHighlighter(RegexHighlighter): @click.option("--markdown", "-m", is_flag=True, help="Display as [u]markdown[/u].") @click.option("--rst", is_flag=True, help="Display [u]restructured text[/u].") @click.option("--csv", is_flag=True, help="Display [u]CSV[/u] as a table.") +@click.option("--ipynb", is_flag=True, help="Display [u]Jupyter notebook[/u].") @click.option("--syntax", is_flag=True, help="[u]Syntax[/u] highlighting.") @click.option("--inspect", is_flag=True, help="[u]Inspect[/u] a python object.") @click.option( @@ -396,6 +398,7 @@ def main( markdown: bool = False, rst: bool = False, csv: bool = False, + ipynb: bool = False, inspect: bool = True, emoji: bool = False, left: bool = False, @@ -478,6 +481,8 @@ def print_usage() -> None: resource_format = CSV elif rst: resource_format = RST + elif ipynb: + resource_format = IPYNB if resource_format == AUTO and "." in resource: import os.path @@ -503,6 +508,8 @@ def print_usage() -> None: resource_format = CSV elif ext == ".rst": resource_format = RST + elif ext == ".ipynb": + resource_format = IPYNB if resource_format == AUTO: resource_format = SYNTAX @@ -591,6 +598,20 @@ def print_usage() -> None: renderable = render_csv(resource, head, tail, title, caption) + elif resource_format == IPYNB: + + renderable = render_ipynb( + resource, + theme, + hyperlinks, + lexer, + head, + tail, + line_numbers, + guides, + no_wrap, + ) + else: if not resource: print_usage() @@ -778,6 +799,99 @@ def render_csv( return table +def render_ipynb( + resource: str, + theme: str, + hyperlinks: bool, + lexer: str, + head: Optional[int], + tail: Optional[int], + line_numbers: bool, + guides: bool, + no_wrap: bool, +) -> RenderableType: + """Render resource as Jupyter notebook. + + Args: + resource (str): Resource string. + theme (str): Syntax theme for code cells. + hyperlinks (bool): Whether to render hyperlinks in Markdown cells. + lexer (str): Lexer for code cell syntax highlighting (if no language set in notebook). + head (int): Display first `head` lines of each cell. + tail (int): Display last `tail` lines of each cell. + line_numbers (bool): Enable line number in code cells. + guides (bool): Enable indentation guides in code cell syntax highlighting. + no_wrap (bool): Don't word wrap syntax highlighted cells. + + Returns: + RenderableType: Notebook as Markdown renderable. + """ + import json + from rich.syntax import Syntax + from rich.console import Group + from rich.panel import Panel + from .markdown import Markdown + + notebook_str, _ = read_resource(resource, None) + notebook_dict = json.loads(notebook_str) + lexer = lexer or notebook_dict.get("metadata", {}).get("kernelspec", {}).get( + "language", "" + ) + + renderable: RenderableType + new_line = True + cells: List[RenderableType] = [] + for cell in notebook_dict["cells"]: + if new_line: + cells.append("") + if "execution_count" in cell: + execution_count = cell["execution_count"] or " " + cells.append(f"[green]In [[#66ff00]{execution_count}[/#66ff00]]:[/green]") + source = "".join(cell["source"]) + if cell["cell_type"] == "code": + num_lines = len(source.splitlines()) + line_range = _line_range(head, tail, num_lines) + renderable = Panel( + Syntax( + source, + lexer, + theme=theme, + line_numbers=line_numbers, + indent_guides=guides, + word_wrap=not no_wrap, + line_range=line_range, + ) + ) + elif cell["cell_type"] == "markdown": + renderable = Markdown(source, code_theme=theme, hyperlinks=hyperlinks) + else: + renderable = Text(source) + new_line = True + cells.append(renderable) + for output in cell.get("outputs", []): + output_type = output["output_type"] + if output_type == "stream": + renderable = "".join(output["text"]) + new_line = False + elif output_type == "error": + renderable = Text("\n".join(output["traceback"]).rstrip()) + new_line = True + elif output_type == "execute_result": + execution_count = output.get("execution_count", " ") or " " + renderable = ( + f"[red]Out[[#ee4b2b]{execution_count}[/#ee4b2b]]:[/red]\n" + + "\n".join(output["data"].get("text/plain", "")) + ) + new_line = True + else: + continue + cells.append(renderable) + + renderable = Group(*cells) + + return renderable + + def _line_range( head: Optional[int], tail: Optional[int], num_lines: int ) -> Optional[Tuple[int, int]]: diff --git a/test_data/notebook.ipynb b/test_data/notebook.ipynb new file mode 100644 index 0000000..432d2e1 --- /dev/null +++ b/test_data/notebook.ipynb @@ -0,0 +1,131 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "9705e233-47a3-48a9-9331-0c8be3bcfece", + "metadata": {}, + "source": [ + "# Jupyter Notebook\n", + "## Introduction" + ] + }, + { + "cell_type": "markdown", + "id": "e76f77cc-5fdd-40cb-bf5e-ce72707a511b", + "metadata": {}, + "source": [ + "This is a *Markdown* cell." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "6733a29a-d919-4285-b8fe-7c0406c52b5d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "This is a code cell.\n" + ] + } + ], + "source": [ + "print(\"This is a code cell.\")" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "cb1b6061-1a48-4267-8fb3-f246e851a15f", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Code cells can have outputs.\n" + ] + }, + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "print(\"Code cells can have outputs.\")\n", + "1 + 2" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "8be0183b-6a01-4334-bcd2-1ed624934dc8", + "metadata": {}, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "unterminated string literal (detected at line 1) (289343476.py, line 1)", + "output_type": "error", + "traceback": [ + "\u001b[0;36m Input \u001b[0;32mIn [3]\u001b[0;36m\u001b[0m\n\u001b[0;31m print(\"Code cell execution can result in a syntax error)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m unterminated string literal (detected at line 1)\n" + ] + } + ], + "source": [ + "print(\"Code cell execution can result in a syntax error)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "1b2741fe-1522-4bdf-8fc6-fd252b8ac245", + "metadata": {}, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'a' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "Input \u001b[0;32mIn [4]\u001b[0m, in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# Traceback are also supported\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[43ma\u001b[49m\n", + "\u001b[0;31mNameError\u001b[0m: name 'a' is not defined" + ] + } + ], + "source": [ + "# Traceback are also supported\n", + "a" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.2" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From 53aa2f56ffea56531d4d4e3bd17ae240983ebcb0 Mon Sep 17 00:00:00 2001 From: David Brochart Date: Thu, 21 Apr 2022 11:34:05 +0200 Subject: [PATCH 08/18] Update install instructions for conda-forge package --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5533049..acd5a7e 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,18 @@ brew install rich ### Universal -Rich-CLI may be installed as a Python package. +Rich-CLI may be installed as a Python package, either using `pip`: ``` python -m pip install rich-cli ``` +Or using `conda` or `mamba`: + +``` +mamba install -c conda-forge rich-cli +``` + ## Rich command Once installed you should have the `rich` command in your path. Run the following to see usage / help: From dcf38793dcfae7668d4186749fe06995bae8ad27 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 30 Apr 2022 09:03:52 +0100 Subject: [PATCH 09/18] fix for pager --- poetry.lock | 212 +++++++++++++++++++++------------------ pyproject.toml | 10 +- src/rich_cli/__main__.py | 16 +-- 3 files changed, 131 insertions(+), 107 deletions(-) diff --git a/poetry.lock b/poetry.lock index 5dd810f..484d009 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,28 +1,24 @@ [[package]] name = "black" -version = "21.12b0" +version = "22.3.0" description = "The uncompromising code formatter." category = "dev" optional = false python-versions = ">=3.6.2" [package.dependencies] -click = ">=7.1.2" +click = ">=8.0.0" mypy-extensions = ">=0.4.3" -pathspec = ">=0.9.0,<1" +pathspec = ">=0.9.0" platformdirs = ">=2" -tomli = ">=0.2.6,<2.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} -typing-extensions = [ - {version = ">=3.10.0.0", markers = "python_version < \"3.10\""}, - {version = "!=3.10.0.1", markers = "python_version >= \"3.10\""}, -] +typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] colorama = ["colorama (>=0.4.3)"] d = ["aiohttp (>=3.7.4)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -python2 = ["typed-ast (>=1.4.3)"] uvloop = ["uvloop (>=0.15.2)"] [[package]] @@ -46,11 +42,11 @@ unicode_backport = ["unicodedata2"] [[package]] name = "click" -version = "8.0.4" +version = "8.1.3" description = "Composable command line interface toolkit" category = "main" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} @@ -110,7 +106,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [[package]] name = "mypy" -version = "0.931" +version = "0.942" description = "Optional static typing for Python" category = "dev" optional = false @@ -125,6 +121,7 @@ typing-extensions = ">=3.10" [package.extras] dmypy = ["psutil (>=4.0)"] python2 = ["typed-ast (>=1.4.0,<2)"] +reports = ["lxml"] [[package]] name = "mypy-extensions" @@ -144,23 +141,23 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" [[package]] name = "platformdirs" -version = "2.5.1" +version = "2.5.2" description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "dev" optional = false python-versions = ">=3.7" [package.extras] -docs = ["Sphinx (>=4)", "furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)"] -test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)"] +docs = ["furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)", "sphinx (>=4)"] +test = ["appdirs (==1.4.4)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)", "pytest (>=6)"] [[package]] name = "pygments" -version = "2.11.2" +version = "2.12.0" description = "Pygments is a syntax highlighting package written in Python." category = "main" optional = false -python-versions = ">=3.5" +python-versions = ">=3.6" [[package]] name = "requests" @@ -182,16 +179,16 @@ use_chardet_on_py3 = ["chardet (>=3.0.2,<5)"] [[package]] name = "rich" -version = "12.0.1" +version = "12.3.0" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" category = "main" optional = false -python-versions = ">=3.6.2,<4.0.0" +python-versions = ">=3.6.3,<4.0.0" [package.dependencies] commonmark = ">=0.9.0,<0.10.0" pygments = ">=2.6.0,<3.0.0" -typing-extensions = {version = ">=3.7.4,<5.0", markers = "python_version < \"3.8\""} +typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.9\""} [package.extras] jupyter = ["ipywidgets (>=7.5.1,<8.0.0)"] @@ -209,27 +206,27 @@ docutils = "*" [[package]] name = "textual" -version = "0.1.17" +version = "0.1.18" description = "Text User Interface using Rich" category = "main" optional = false python-versions = ">=3.7,<4.0" [package.dependencies] -rich = ">=12.0.0,<13.0.0" -typing-extensions = {version = ">=3.10.0,<4.0.0", markers = "python_version < \"3.8\""} +rich = ">=12.3.0,<13.0.0" +typing-extensions = {version = ">=4.0.0,<5.0", markers = "python_version < \"3.9\""} [[package]] name = "tomli" -version = "1.2.3" +version = "2.0.1" description = "A lil' TOML parser" category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [[package]] name = "typed-ast" -version = "1.5.2" +version = "1.5.3" description = "a fork of Python 2 and 3 ast modules with type comment support" category = "dev" optional = false @@ -237,11 +234,11 @@ python-versions = ">=3.6" [[package]] name = "typing-extensions" -version = "3.10.0.2" -description = "Backported and Experimental Type Hints for Python 3.5+" +version = "4.2.0" +description = "Backported and Experimental Type Hints for Python 3.7+" category = "main" optional = false -python-versions = "*" +python-versions = ">=3.7" [[package]] name = "urllib3" @@ -258,25 +255,46 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "zipp" -version = "3.7.0" +version = "3.8.0" description = "Backport of pathlib-compatible object wrapper for zip files" category = "main" optional = false python-versions = ">=3.7" [package.extras] -docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] +docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"] [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "24b10f1b7c0e3b72b27a6bbdddd415b9ce2388311c956b996ec2ccf17cc18497" +content-hash = "898ef05d770288bf54cfe3c14788071dc4dfcd6f4b28deefbcdd7611f4f562f8" [metadata.files] black = [ - {file = "black-21.12b0-py3-none-any.whl", hash = "sha256:a615e69ae185e08fdd73e4715e260e2479c861b5740057fde6e8b4e3b7dd589f"}, - {file = "black-21.12b0.tar.gz", hash = "sha256:77b80f693a569e2e527958459634f18df9b0ba2625ba4e0c2d5da5be42e6f2b3"}, + {file = "black-22.3.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:2497f9c2386572e28921fa8bec7be3e51de6801f7459dffd6e62492531c47e09"}, + {file = "black-22.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5795a0375eb87bfe902e80e0c8cfaedf8af4d49694d69161e5bd3206c18618bb"}, + {file = "black-22.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e3556168e2e5c49629f7b0f377070240bd5511e45e25a4497bb0073d9dda776a"}, + {file = "black-22.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67c8301ec94e3bcc8906740fe071391bce40a862b7be0b86fb5382beefecd968"}, + {file = "black-22.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:fd57160949179ec517d32ac2ac898b5f20d68ed1a9c977346efbac9c2f1e779d"}, + {file = "black-22.3.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cc1e1de68c8e5444e8f94c3670bb48a2beef0e91dddfd4fcc29595ebd90bb9ce"}, + {file = "black-22.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d2fc92002d44746d3e7db7cf9313cf4452f43e9ea77a2c939defce3b10b5c82"}, + {file = "black-22.3.0-cp36-cp36m-win_amd64.whl", hash = "sha256:a6342964b43a99dbc72f72812bf88cad8f0217ae9acb47c0d4f141a6416d2d7b"}, + {file = "black-22.3.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:328efc0cc70ccb23429d6be184a15ce613f676bdfc85e5fe8ea2a9354b4e9015"}, + {file = "black-22.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06f9d8846f2340dfac80ceb20200ea5d1b3f181dd0556b47af4e8e0b24fa0a6b"}, + {file = "black-22.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:ad4efa5fad66b903b4a5f96d91461d90b9507a812b3c5de657d544215bb7877a"}, + {file = "black-22.3.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e8477ec6bbfe0312c128e74644ac8a02ca06bcdb8982d4ee06f209be28cdf163"}, + {file = "black-22.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:637a4014c63fbf42a692d22b55d8ad6968a946b4a6ebc385c5505d9625b6a464"}, + {file = "black-22.3.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:863714200ada56cbc366dc9ae5291ceb936573155f8bf8e9de92aef51f3ad0f0"}, + {file = "black-22.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10dbe6e6d2988049b4655b2b739f98785a884d4d6b85bc35133a8fb9a2233176"}, + {file = "black-22.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:cee3e11161dde1b2a33a904b850b0899e0424cc331b7295f2a9698e79f9a69a0"}, + {file = "black-22.3.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5891ef8abc06576985de8fa88e95ab70641de6c1fca97e2a15820a9b69e51b20"}, + {file = "black-22.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:30d78ba6bf080eeaf0b7b875d924b15cd46fec5fd044ddfbad38c8ea9171043a"}, + {file = "black-22.3.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ee8f1f7228cce7dffc2b464f07ce769f478968bfb3dd1254a4c2eeed84928aad"}, + {file = "black-22.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6ee227b696ca60dd1c507be80a6bc849a5a6ab57ac7352aad1ffec9e8b805f21"}, + {file = "black-22.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:9b542ced1ec0ceeff5b37d69838106a6348e60db7b8fdd245294dc1d26136265"}, + {file = "black-22.3.0-py3-none-any.whl", hash = "sha256:bc58025940a896d7e5356952228b68f793cf5fcb342be703c3a2669a1488cb72"}, + {file = "black-22.3.0.tar.gz", hash = "sha256:35020b8886c022ced9282b51b5a875b6d1ab0c387b31a065b84db7c33085ca79"}, ] certifi = [ {file = "certifi-2021.10.8-py2.py3-none-any.whl", hash = "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569"}, @@ -287,8 +305,8 @@ charset-normalizer = [ {file = "charset_normalizer-2.0.12-py3-none-any.whl", hash = "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df"}, ] click = [ - {file = "click-8.0.4-py3-none-any.whl", hash = "sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1"}, - {file = "click-8.0.4.tar.gz", hash = "sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb"}, + {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, + {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, ] colorama = [ {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, @@ -311,26 +329,29 @@ importlib-metadata = [ {file = "importlib_metadata-4.11.3.tar.gz", hash = "sha256:ea4c597ebf37142f827b8f39299579e31685c31d3a438b59f469406afd0f2539"}, ] mypy = [ - {file = "mypy-0.931-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3c5b42d0815e15518b1f0990cff7a705805961613e701db60387e6fb663fe78a"}, - {file = "mypy-0.931-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c89702cac5b302f0c5d33b172d2b55b5df2bede3344a2fbed99ff96bddb2cf00"}, - {file = "mypy-0.931-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:300717a07ad09525401a508ef5d105e6b56646f7942eb92715a1c8d610149714"}, - {file = "mypy-0.931-cp310-cp310-win_amd64.whl", hash = "sha256:7b3f6f557ba4afc7f2ce6d3215d5db279bcf120b3cfd0add20a5d4f4abdae5bc"}, - {file = "mypy-0.931-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:1bf752559797c897cdd2c65f7b60c2b6969ffe458417b8d947b8340cc9cec08d"}, - {file = "mypy-0.931-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4365c60266b95a3f216a3047f1d8e3f895da6c7402e9e1ddfab96393122cc58d"}, - {file = "mypy-0.931-cp36-cp36m-win_amd64.whl", hash = "sha256:1b65714dc296a7991000b6ee59a35b3f550e0073411ac9d3202f6516621ba66c"}, - {file = "mypy-0.931-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e839191b8da5b4e5d805f940537efcaa13ea5dd98418f06dc585d2891d228cf0"}, - {file = "mypy-0.931-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:50c7346a46dc76a4ed88f3277d4959de8a2bd0a0fa47fa87a4cde36fe247ac05"}, - {file = "mypy-0.931-cp37-cp37m-win_amd64.whl", hash = "sha256:d8f1ff62f7a879c9fe5917b3f9eb93a79b78aad47b533911b853a757223f72e7"}, - {file = "mypy-0.931-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f9fe20d0872b26c4bba1c1be02c5340de1019530302cf2dcc85c7f9fc3252ae0"}, - {file = "mypy-0.931-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:1b06268df7eb53a8feea99cbfff77a6e2b205e70bf31743e786678ef87ee8069"}, - {file = "mypy-0.931-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8c11003aaeaf7cc2d0f1bc101c1cc9454ec4cc9cb825aef3cafff8a5fdf4c799"}, - {file = "mypy-0.931-cp38-cp38-win_amd64.whl", hash = "sha256:d9d2b84b2007cea426e327d2483238f040c49405a6bf4074f605f0156c91a47a"}, - {file = "mypy-0.931-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ff3bf387c14c805ab1388185dd22d6b210824e164d4bb324b195ff34e322d166"}, - {file = "mypy-0.931-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5b56154f8c09427bae082b32275a21f500b24d93c88d69a5e82f3978018a0266"}, - {file = "mypy-0.931-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8ca7f8c4b1584d63c9a0f827c37ba7a47226c19a23a753d52e5b5eddb201afcd"}, - {file = "mypy-0.931-cp39-cp39-win_amd64.whl", hash = "sha256:74f7eccbfd436abe9c352ad9fb65872cc0f1f0a868e9d9c44db0893440f0c697"}, - {file = "mypy-0.931-py3-none-any.whl", hash = "sha256:1171f2e0859cfff2d366da2c7092b06130f232c636a3f7301e3feb8b41f6377d"}, - {file = "mypy-0.931.tar.gz", hash = "sha256:0038b21890867793581e4cb0d810829f5fd4441aa75796b53033af3aa30430ce"}, + {file = "mypy-0.942-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5bf44840fb43ac4074636fd47ee476d73f0039f4f54e86d7265077dc199be24d"}, + {file = "mypy-0.942-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dcd955f36e0180258a96f880348fbca54ce092b40fbb4b37372ae3b25a0b0a46"}, + {file = "mypy-0.942-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6776e5fa22381cc761df53e7496a805801c1a751b27b99a9ff2f0ca848c7eca0"}, + {file = "mypy-0.942-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:edf7237137a1a9330046dbb14796963d734dd740a98d5e144a3eb1d267f5f9ee"}, + {file = "mypy-0.942-cp310-cp310-win_amd64.whl", hash = "sha256:64235137edc16bee6f095aba73be5334677d6f6bdb7fa03cfab90164fa294a17"}, + {file = "mypy-0.942-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:b840cfe89c4ab6386c40300689cd8645fc8d2d5f20101c7f8bd23d15fca14904"}, + {file = "mypy-0.942-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:2b184db8c618c43c3a31b32ff00cd28195d39e9c24e7c3b401f3db7f6e5767f5"}, + {file = "mypy-0.942-cp36-cp36m-win_amd64.whl", hash = "sha256:1a0459c333f00e6a11cbf6b468b870c2b99a906cb72d6eadf3d1d95d38c9352c"}, + {file = "mypy-0.942-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4c3e497588afccfa4334a9986b56f703e75793133c4be3a02d06a3df16b67a58"}, + {file = "mypy-0.942-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6f6ad963172152e112b87cc7ec103ba0f2db2f1cd8997237827c052a3903eaa6"}, + {file = "mypy-0.942-cp37-cp37m-win_amd64.whl", hash = "sha256:0e2dd88410937423fba18e57147dd07cd8381291b93d5b1984626f173a26543e"}, + {file = "mypy-0.942-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:246e1aa127d5b78488a4a0594bd95f6d6fb9d63cf08a66dafbff8595d8891f67"}, + {file = "mypy-0.942-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d8d3ba77e56b84cd47a8ee45b62c84b6d80d32383928fe2548c9a124ea0a725c"}, + {file = "mypy-0.942-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2bc249409a7168d37c658e062e1ab5173300984a2dada2589638568ddc1db02b"}, + {file = "mypy-0.942-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:9521c1265ccaaa1791d2c13582f06facf815f426cd8b07c3a485f486a8ffc1f3"}, + {file = "mypy-0.942-cp38-cp38-win_amd64.whl", hash = "sha256:e865fec858d75b78b4d63266c9aff770ecb6a39dfb6d6b56c47f7f8aba6baba8"}, + {file = "mypy-0.942-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:6ce34a118d1a898f47def970a2042b8af6bdcc01546454726c7dd2171aa6dfca"}, + {file = "mypy-0.942-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:10daab80bc40f84e3f087d896cdb53dc811a9f04eae4b3f95779c26edee89d16"}, + {file = "mypy-0.942-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3841b5433ff936bff2f4dc8d54cf2cdbfea5d8e88cedfac45c161368e5770ba6"}, + {file = "mypy-0.942-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6f7106cbf9cc2f403693bf50ed7c9fa5bb3dfa9007b240db3c910929abe2a322"}, + {file = "mypy-0.942-cp39-cp39-win_amd64.whl", hash = "sha256:7742d2c4e46bb5017b51c810283a6a389296cda03df805a4f7869a6f41246534"}, + {file = "mypy-0.942-py3-none-any.whl", hash = "sha256:a1b383fe99678d7402754fe90448d4037f9512ce70c21f8aee3b8bf48ffc51db"}, + {file = "mypy-0.942.tar.gz", hash = "sha256:17e44649fec92e9f82102b48a3bf7b4a5510ad0cd22fa21a104826b5db4903e2"}, ] mypy-extensions = [ {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, @@ -341,69 +362,68 @@ pathspec = [ {file = "pathspec-0.9.0.tar.gz", hash = "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"}, ] platformdirs = [ - {file = "platformdirs-2.5.1-py3-none-any.whl", hash = "sha256:bcae7cab893c2d310a711b70b24efb93334febe65f8de776ee320b517471e227"}, - {file = "platformdirs-2.5.1.tar.gz", hash = "sha256:7535e70dfa32e84d4b34996ea99c5e432fa29a708d0f4e394bbcb2a8faa4f16d"}, + {file = "platformdirs-2.5.2-py3-none-any.whl", hash = "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788"}, + {file = "platformdirs-2.5.2.tar.gz", hash = "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"}, ] pygments = [ - {file = "Pygments-2.11.2-py3-none-any.whl", hash = "sha256:44238f1b60a76d78fc8ca0528ee429702aae011c265fe6a8dd8b63049ae41c65"}, - {file = "Pygments-2.11.2.tar.gz", hash = "sha256:4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a"}, + {file = "Pygments-2.12.0-py3-none-any.whl", hash = "sha256:dc9c10fb40944260f6ed4c688ece0cd2048414940f1cea51b8b226318411c519"}, + {file = "Pygments-2.12.0.tar.gz", hash = "sha256:5eb116118f9612ff1ee89ac96437bb6b49e8f04d8a13b514ba26f620208e26eb"}, ] requests = [ {file = "requests-2.27.1-py2.py3-none-any.whl", hash = "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d"}, {file = "requests-2.27.1.tar.gz", hash = "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61"}, ] rich = [ - {file = "rich-12.0.1-py3-none-any.whl", hash = "sha256:ce5c714e984a2d185399e4e1dd1f8b2feacb7cecfc576f1522425643a36a57ea"}, - {file = "rich-12.0.1.tar.gz", hash = "sha256:3fba9dd15ebe048e2795a02ac19baee79dc12cc50b074ef70f2958cd651b59a9"}, + {file = "rich-12.3.0-py3-none-any.whl", hash = "sha256:0eb63013630c6ee1237e0e395d51cb23513de6b5531235e33889e8842bdf3a6f"}, + {file = "rich-12.3.0.tar.gz", hash = "sha256:7e8700cda776337036a712ff0495b04052fb5f957c7dfb8df997f88350044b64"}, ] rich-rst = [ {file = "rich-rst-1.1.7.tar.gz", hash = "sha256:898bd5defd6bde9fba819614575dc5bff18047af38ae1981de0c1e78f17bbfd5"}, {file = "rich_rst-1.1.7-py3-none-any.whl", hash = "sha256:9acf096a5902ef762498e5e510c15dab4ed92bb1f16b2f294f397e4f40048785"}, ] textual = [ - {file = "textual-0.1.17-py3-none-any.whl", hash = "sha256:12c3e7d77faa76463e40e4eff58d591143770bb61780ecf0d2dae65e783896cd"}, - {file = "textual-0.1.17.tar.gz", hash = "sha256:af6aa1fa34fe6d40689ce55a7bf519a07e48523a75b95cbed572990e0d6b6f84"}, + {file = "textual-0.1.18-py3-none-any.whl", hash = "sha256:59110935418c597c1c50876edfd6799ad5b59d51a91ca6744fc45e36eb89638e"}, + {file = "textual-0.1.18.tar.gz", hash = "sha256:b2883f8ed291de58b9aa73de6d24bbaae0174687487458a4eb2a7c188a2acf23"}, ] tomli = [ - {file = "tomli-1.2.3-py3-none-any.whl", hash = "sha256:e3069e4be3ead9668e21cb9b074cd948f7b3113fd9c8bba083f48247aab8b11c"}, - {file = "tomli-1.2.3.tar.gz", hash = "sha256:05b6166bff487dc068d322585c7ea4ef78deed501cc124060e0f238e89a9231f"}, + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] typed-ast = [ - {file = "typed_ast-1.5.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:183b183b7771a508395d2cbffd6db67d6ad52958a5fdc99f450d954003900266"}, - {file = "typed_ast-1.5.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:676d051b1da67a852c0447621fdd11c4e104827417bf216092ec3e286f7da596"}, - {file = "typed_ast-1.5.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bc2542e83ac8399752bc16e0b35e038bdb659ba237f4222616b4e83fb9654985"}, - {file = "typed_ast-1.5.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:74cac86cc586db8dfda0ce65d8bcd2bf17b58668dfcc3652762f3ef0e6677e76"}, - {file = "typed_ast-1.5.2-cp310-cp310-win_amd64.whl", hash = "sha256:18fe320f354d6f9ad3147859b6e16649a0781425268c4dde596093177660e71a"}, - {file = "typed_ast-1.5.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:31d8c6b2df19a777bc8826770b872a45a1f30cfefcfd729491baa5237faae837"}, - {file = "typed_ast-1.5.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:963a0ccc9a4188524e6e6d39b12c9ca24cc2d45a71cfdd04a26d883c922b4b78"}, - {file = "typed_ast-1.5.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:0eb77764ea470f14fcbb89d51bc6bbf5e7623446ac4ed06cbd9ca9495b62e36e"}, - {file = "typed_ast-1.5.2-cp36-cp36m-win_amd64.whl", hash = "sha256:294a6903a4d087db805a7656989f613371915fc45c8cc0ddc5c5a0a8ad9bea4d"}, - {file = "typed_ast-1.5.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:26a432dc219c6b6f38be20a958cbe1abffcc5492821d7e27f08606ef99e0dffd"}, - {file = "typed_ast-1.5.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c7407cfcad702f0b6c0e0f3e7ab876cd1d2c13b14ce770e412c0c4b9728a0f88"}, - {file = "typed_ast-1.5.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f30ddd110634c2d7534b2d4e0e22967e88366b0d356b24de87419cc4410c41b7"}, - {file = "typed_ast-1.5.2-cp37-cp37m-win_amd64.whl", hash = "sha256:8c08d6625bb258179b6e512f55ad20f9dfef019bbfbe3095247401e053a3ea30"}, - {file = "typed_ast-1.5.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:90904d889ab8e81a956f2c0935a523cc4e077c7847a836abee832f868d5c26a4"}, - {file = "typed_ast-1.5.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:bbebc31bf11762b63bf61aaae232becb41c5bf6b3461b80a4df7e791fabb3aca"}, - {file = "typed_ast-1.5.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c29dd9a3a9d259c9fa19d19738d021632d673f6ed9b35a739f48e5f807f264fb"}, - {file = "typed_ast-1.5.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:58ae097a325e9bb7a684572d20eb3e1809802c5c9ec7108e85da1eb6c1a3331b"}, - {file = "typed_ast-1.5.2-cp38-cp38-win_amd64.whl", hash = "sha256:da0a98d458010bf4fe535f2d1e367a2e2060e105978873c04c04212fb20543f7"}, - {file = "typed_ast-1.5.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:33b4a19ddc9fc551ebabca9765d54d04600c4a50eda13893dadf67ed81d9a098"}, - {file = "typed_ast-1.5.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1098df9a0592dd4c8c0ccfc2e98931278a6c6c53cb3a3e2cf7e9ee3b06153344"}, - {file = "typed_ast-1.5.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42c47c3b43fe3a39ddf8de1d40dbbfca60ac8530a36c9b198ea5b9efac75c09e"}, - {file = "typed_ast-1.5.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f290617f74a610849bd8f5514e34ae3d09eafd521dceaa6cf68b3f4414266d4e"}, - {file = "typed_ast-1.5.2-cp39-cp39-win_amd64.whl", hash = "sha256:df05aa5b241e2e8045f5f4367a9f6187b09c4cdf8578bb219861c4e27c443db5"}, - {file = "typed_ast-1.5.2.tar.gz", hash = "sha256:525a2d4088e70a9f75b08b3f87a51acc9cde640e19cc523c7e41aa355564ae27"}, + {file = "typed_ast-1.5.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9ad3b48cf2b487be140072fb86feff36801487d4abb7382bb1929aaac80638ea"}, + {file = "typed_ast-1.5.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:542cd732351ba8235f20faa0fc7398946fe1a57f2cdb289e5497e1e7f48cfedb"}, + {file = "typed_ast-1.5.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5dc2c11ae59003d4a26dda637222d9ae924387f96acae9492df663843aefad55"}, + {file = "typed_ast-1.5.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:fd5df1313915dbd70eaaa88c19030b441742e8b05e6103c631c83b75e0435ccc"}, + {file = "typed_ast-1.5.3-cp310-cp310-win_amd64.whl", hash = "sha256:e34f9b9e61333ecb0f7d79c21c28aa5cd63bec15cb7e1310d7d3da6ce886bc9b"}, + {file = "typed_ast-1.5.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f818c5b81966d4728fec14caa338e30a70dfc3da577984d38f97816c4b3071ec"}, + {file = "typed_ast-1.5.3-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3042bfc9ca118712c9809201f55355479cfcdc17449f9f8db5e744e9625c6805"}, + {file = "typed_ast-1.5.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4fff9fdcce59dc61ec1b317bdb319f8f4e6b69ebbe61193ae0a60c5f9333dc49"}, + {file = "typed_ast-1.5.3-cp36-cp36m-win_amd64.whl", hash = "sha256:8e0b8528838ffd426fea8d18bde4c73bcb4167218998cc8b9ee0a0f2bfe678a6"}, + {file = "typed_ast-1.5.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8ef1d96ad05a291f5c36895d86d1375c0ee70595b90f6bb5f5fdbee749b146db"}, + {file = "typed_ast-1.5.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed44e81517364cb5ba367e4f68fca01fba42a7a4690d40c07886586ac267d9b9"}, + {file = "typed_ast-1.5.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f60d9de0d087454c91b3999a296d0c4558c1666771e3460621875021bf899af9"}, + {file = "typed_ast-1.5.3-cp37-cp37m-win_amd64.whl", hash = "sha256:9e237e74fd321a55c90eee9bc5d44be976979ad38a29bbd734148295c1ce7617"}, + {file = "typed_ast-1.5.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ee852185964744987609b40aee1d2eb81502ae63ee8eef614558f96a56c1902d"}, + {file = "typed_ast-1.5.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:27e46cdd01d6c3a0dd8f728b6a938a6751f7bd324817501c15fb056307f918c6"}, + {file = "typed_ast-1.5.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d64dabc6336ddc10373922a146fa2256043b3b43e61f28961caec2a5207c56d5"}, + {file = "typed_ast-1.5.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8cdf91b0c466a6c43f36c1964772918a2c04cfa83df8001ff32a89e357f8eb06"}, + {file = "typed_ast-1.5.3-cp38-cp38-win_amd64.whl", hash = "sha256:9cc9e1457e1feb06b075c8ef8aeb046a28ec351b1958b42c7c31c989c841403a"}, + {file = "typed_ast-1.5.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e20d196815eeffb3d76b75223e8ffed124e65ee62097e4e73afb5fec6b993e7a"}, + {file = "typed_ast-1.5.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:37e5349d1d5de2f4763d534ccb26809d1c24b180a477659a12c4bde9dd677d74"}, + {file = "typed_ast-1.5.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c9f1a27592fac87daa4e3f16538713d705599b0a27dfe25518b80b6b017f0a6d"}, + {file = "typed_ast-1.5.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8831479695eadc8b5ffed06fdfb3e424adc37962a75925668deeb503f446c0a3"}, + {file = "typed_ast-1.5.3-cp39-cp39-win_amd64.whl", hash = "sha256:20d5118e494478ef2d3a2702d964dae830aedd7b4d3b626d003eea526be18718"}, + {file = "typed_ast-1.5.3.tar.gz", hash = "sha256:27f25232e2dd0edfe1f019d6bfaaf11e86e657d9bdb7b0956db95f560cceb2b3"}, ] typing-extensions = [ - {file = "typing_extensions-3.10.0.2-py2-none-any.whl", hash = "sha256:d8226d10bc02a29bcc81df19a26e56a9647f8b0a6d4a83924139f4a8b01f17b7"}, - {file = "typing_extensions-3.10.0.2-py3-none-any.whl", hash = "sha256:f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34"}, - {file = "typing_extensions-3.10.0.2.tar.gz", hash = "sha256:49f75d16ff11f1cd258e1b988ccff82a3ca5570217d7ad8c5f48205dd99a677e"}, + {file = "typing_extensions-4.2.0-py3-none-any.whl", hash = "sha256:6657594ee297170d19f67d55c05852a874e7eb634f4f753dbd667855e07c1708"}, + {file = "typing_extensions-4.2.0.tar.gz", hash = "sha256:f1c24655a0da0d1b67f07e17a5e6b2a105894e6824b92096378bb3668ef02376"}, ] urllib3 = [ {file = "urllib3-1.26.9-py2.py3-none-any.whl", hash = "sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14"}, {file = "urllib3-1.26.9.tar.gz", hash = "sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e"}, ] zipp = [ - {file = "zipp-3.7.0-py3-none-any.whl", hash = "sha256:b47250dd24f92b7dd6a0a8fc5244da14608f3ca90a5efcd37a3b1642fac9a375"}, - {file = "zipp-3.7.0.tar.gz", hash = "sha256:9f50f446828eb9d45b267433fd3e9da8d801f614129124863f9c51ebceafb87d"}, + {file = "zipp-3.8.0-py3-none-any.whl", hash = "sha256:c4f6e5bbf48e74f7a38e7cc5b0480ff42b0ae5178957d564d18932525d5cf099"}, + {file = "zipp-3.8.0.tar.gz", hash = "sha256:56bf8aadb83c24db6c4b577e13de374ccfb67da2078beba1d037c17980bf43ad"}, ] diff --git a/pyproject.toml b/pyproject.toml index 5271c4c..5170563 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "rich-cli" homepage = "https://github.com/Textualize/rich-cli" -version = "1.6.1" +version = "1.7.0" description = "Command Line Interface to Rich" authors = ["Will McGugan "] license = "MIT" @@ -23,15 +23,15 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.7" -rich = "^12.0.0" +rich = "^12.3.0" click = "^8.0.0" requests = "^2.0.0" -textual = "^0.1.15" +textual = "^0.1.18" rich-rst = "^1.1.7" [tool.poetry.dev-dependencies] -black = "21.1.0" -mypy = "0.941" +black = "22.3.0" +mypy = "0.942" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/src/rich_cli/__main__.py b/src/rich_cli/__main__.py index a19c954..879307d 100644 --- a/src/rich_cli/__main__.py +++ b/src/rich_cli/__main__.py @@ -37,7 +37,7 @@ "toml": "toml", } -VERSION = "1.6.1" +VERSION = "1.7.0" AUTO = 0 @@ -860,7 +860,8 @@ def render_ipynb( indent_guides=guides, word_wrap=not no_wrap, line_range=line_range, - ) + ), + border_style="dim", ) elif cell["cell_type"] == "markdown": renderable = Markdown(source, code_theme=theme, hyperlinks=hyperlinks) @@ -871,20 +872,23 @@ def render_ipynb( for output in cell.get("outputs", []): output_type = output["output_type"] if output_type == "stream": - renderable = "".join(output["text"]) + renderable = Text.from_ansi("".join(output["text"])) new_line = False elif output_type == "error": - renderable = Text("\n".join(output["traceback"]).rstrip()) + renderable = Text.from_ansi("\n".join(output["traceback"]).rstrip()) new_line = True elif output_type == "execute_result": execution_count = output.get("execution_count", " ") or " " - renderable = ( + renderable = Text.from_markup( f"[red]Out[[#ee4b2b]{execution_count}[/#ee4b2b]]:[/red]\n" - + "\n".join(output["data"].get("text/plain", "")) + ) + renderable += Text.from_ansi( + "\n".join(output["data"].get("text/plain", "")) ) new_line = True else: continue + cells.append(renderable) renderable = Group(*cells) From fb40989309af829d21178995894bbe45496c5d22 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 30 Apr 2022 09:09:24 +0100 Subject: [PATCH 10/18] changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20de36a..1e759cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.7.0] - 2022-04-30 + +## Added + +- Added Jupyter Notebook support https://github.com/Textualize/rich-cli/pull/47 +- Added support for vi navigation to pager https://github.com/Textualize/rich-cli/pull/44/ + ## [1.6.1] - 2022-04-23 ### Fixed From 2f6e58710a69d0f7e60ce0e861b2bd3802092ba0 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 30 Apr 2022 11:21:43 +0100 Subject: [PATCH 11/18] fix for non-list --- src/rich_cli/__main__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rich_cli/__main__.py b/src/rich_cli/__main__.py index 879307d..8636b6d 100644 --- a/src/rich_cli/__main__.py +++ b/src/rich_cli/__main__.py @@ -882,9 +882,11 @@ def render_ipynb( renderable = Text.from_markup( f"[red]Out[[#ee4b2b]{execution_count}[/#ee4b2b]]:[/red]\n" ) - renderable += Text.from_ansi( - "\n".join(output["data"].get("text/plain", "")) - ) + data = output["data"].get("text/plain", "") + if isinstance(data, list): + renderable += Text.from_ansi("\n".join(data)) + else: + renderable += Text.from_ansi(data) new_line = True else: continue From 57f74eeb5710301b6e63af9b06e63c259f7f84fa Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 30 Apr 2022 13:40:31 +0100 Subject: [PATCH 12/18] added svg output --- src/rich_cli/__main__.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/rich_cli/__main__.py b/src/rich_cli/__main__.py index 8636b6d..e274fe8 100644 --- a/src/rich_cli/__main__.py +++ b/src/rich_cli/__main__.py @@ -231,9 +231,16 @@ class OptionHighlighter(RegexHighlighter): ) ) + from rich.color import Color + console.print( - blend_text("♥ https://www.textualize.io", (32, 32, 255), (255, 32, 255)), - justify="right", + blend_text( + "♥ https://www.textualize.io", + Color.parse("#b169dd").triplet, + Color.parse("#542c91").triplet, + ), + justify="left", + style="bold", ) @@ -385,6 +392,9 @@ class OptionHighlighter(RegexHighlighter): default="", help="Write HTML to [b]PATH[/b].", ) +@click.option( + "--export-svg", metavar="PATH", default="", help="Write SVG to [b]PATH[/b]." +) @click.option("--pager", is_flag=True, help="Display in an interactive pager.") @click.option("--version", "-v", is_flag=True, help="Print version and exit.") def main( @@ -428,7 +438,8 @@ def main( lexer: str = "", hyperlinks: bool = False, force_terminal: bool = False, - export_html: Optional[str] = None, + export_html: str = "", + export_svg: str = "", pager: bool = False, ): """Rich toolbox for console output.""" @@ -437,7 +448,7 @@ def main( return console = Console( emoji=emoji, - record=bool(export_html), + record=bool(export_html or export_svg), force_terminal=force_terminal if force_terminal else None, ) @@ -711,10 +722,16 @@ def print_usage() -> None: if export_html: try: - console.save_html(export_html) + console.save_html(export_html, clear=False) except Exception as error: on_error("failed to save HTML", error) + if export_svg: + try: + console.save_svg(export_svg, clear=False) + except Exception as error: + on_error("failed to save SVG", error) + def render_csv( resource: str, From a0ff19489a9648d20e26b02a31466de2e2d1f5ac Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 30 Apr 2022 13:56:27 +0100 Subject: [PATCH 13/18] fix for multiple lines --- src/rich_cli/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rich_cli/__main__.py b/src/rich_cli/__main__.py index e274fe8..146bd8b 100644 --- a/src/rich_cli/__main__.py +++ b/src/rich_cli/__main__.py @@ -901,7 +901,7 @@ def render_ipynb( ) data = output["data"].get("text/plain", "") if isinstance(data, list): - renderable += Text.from_ansi("\n".join(data)) + renderable += Text.from_ansi("".join(data)) else: renderable += Text.from_ansi(data) new_line = True From dc9fceda1ed9ce5670561893e62f21811c2bd313 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sun, 1 May 2022 09:38:09 +0100 Subject: [PATCH 14/18] changelog --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e759cd..e70239c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.7.0] - 2022-04-30 +## [1.7.0] - 2022-05-1 ## Added - Added Jupyter Notebook support https://github.com/Textualize/rich-cli/pull/47 +- Added --export-svg option - Added support for vi navigation to pager https://github.com/Textualize/rich-cli/pull/44/ ## [1.6.1] - 2022-04-23 @@ -27,5 +28,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Change how code blocks in markdown are rendered (remove border, adding padding) - -[unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v1.5.1...HEAD From 178c5629ba3f3d0473908aa544049efae321bbbb Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 7 May 2022 16:39:21 +0100 Subject: [PATCH 15/18] bump version --- CHANGELOG.md | 6 ++++++ poetry.lock | 8 ++++---- pyproject.toml | 4 ++-- src/rich_cli/__main__.py | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e70239c..9f1665f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.8.0] - 2022-05-07 + +### Changed + +- Bumped Rich for improved SVG export + ## [1.7.0] - 2022-05-1 ## Added diff --git a/poetry.lock b/poetry.lock index 484d009..a708472 100644 --- a/poetry.lock +++ b/poetry.lock @@ -179,7 +179,7 @@ use_chardet_on_py3 = ["chardet (>=3.0.2,<5)"] [[package]] name = "rich" -version = "12.3.0" +version = "12.4.0" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" category = "main" optional = false @@ -268,7 +268,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest- [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "898ef05d770288bf54cfe3c14788071dc4dfcd6f4b28deefbcdd7611f4f562f8" +content-hash = "78e06c2473bf38887e7fe55c9a38b77ba99bcda202252ca1136fae511ae81cd6" [metadata.files] black = [ @@ -374,8 +374,8 @@ requests = [ {file = "requests-2.27.1.tar.gz", hash = "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61"}, ] rich = [ - {file = "rich-12.3.0-py3-none-any.whl", hash = "sha256:0eb63013630c6ee1237e0e395d51cb23513de6b5531235e33889e8842bdf3a6f"}, - {file = "rich-12.3.0.tar.gz", hash = "sha256:7e8700cda776337036a712ff0495b04052fb5f957c7dfb8df997f88350044b64"}, + {file = "rich-12.4.0-py3-none-any.whl", hash = "sha256:fdf6f447f231289dd446d31e5ee856fb0cc7dccd852a80f3e9d5aeecccabaedc"}, + {file = "rich-12.4.0.tar.gz", hash = "sha256:7aebf67874dc5cc2c89e2cb6ac322c95bd92510df2af0296c8bf494335ef704f"}, ] rich-rst = [ {file = "rich-rst-1.1.7.tar.gz", hash = "sha256:898bd5defd6bde9fba819614575dc5bff18047af38ae1981de0c1e78f17bbfd5"}, diff --git a/pyproject.toml b/pyproject.toml index 5170563..22d89f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "rich-cli" homepage = "https://github.com/Textualize/rich-cli" -version = "1.7.0" +version = "1.8.0" description = "Command Line Interface to Rich" authors = ["Will McGugan "] license = "MIT" @@ -23,7 +23,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.7" -rich = "^12.3.0" +rich = "^12.4.0" click = "^8.0.0" requests = "^2.0.0" textual = "^0.1.18" diff --git a/src/rich_cli/__main__.py b/src/rich_cli/__main__.py index 146bd8b..5fcdc7b 100644 --- a/src/rich_cli/__main__.py +++ b/src/rich_cli/__main__.py @@ -37,7 +37,7 @@ "toml": "toml", } -VERSION = "1.7.0" +VERSION = "1.8.0" AUTO = 0 From 0e237ec4302f63b55609b21a1a487d097b8768f7 Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Thu, 12 May 2022 12:00:54 +0100 Subject: [PATCH 16/18] fix generic blend text --- src/rich_cli/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rich_cli/__main__.py b/src/rich_cli/__main__.py index 5fcdc7b..4a5eb32 100644 --- a/src/rich_cli/__main__.py +++ b/src/rich_cli/__main__.py @@ -155,7 +155,7 @@ def blend_text( size = len(text) for index in range(size): blend = index / size - color = f"#{int(r1 + dr * blend):2X}{int(g1 + dg * blend):2X}{int(b1 + db * blend):2X}" + color = f"#{int(r1 + dr * blend):02X}{int(g1 + dg * blend):02X}{int(b1 + db * blend):02X}" text.stylize(color, index, index + 1) return text From 2d62b33f8b078745c500723f551fe375f73c8958 Mon Sep 17 00:00:00 2001 From: Olivier Philippon Date: Tue, 14 Jun 2022 13:09:08 +0100 Subject: [PATCH 17/18] [pyproject] Remove Python 3.6 classifier --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 22d89f5..f766f86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ classifiers = [ "Operating System :: Microsoft :: Windows", "Operating System :: MacOS", "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", From 53cb0e9f8ddcfccafc2073a05370928fed2bb8b9 Mon Sep 17 00:00:00 2001 From: Olivier Philippon Date: Tue, 14 Jun 2022 11:54:35 +0100 Subject: [PATCH 18/18] Hard-code UTF-8 encoding for the input file --- CHANGELOG.md | 6 ++++++ README.md | 4 ++-- src/rich_cli/__main__.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f1665f..1b15e17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Rich-CLI now assumes that the input file is encoded in UTF-8 https://github.com/Textualize/rich-cli/pull/56 + ## [1.8.0] - 2022-05-07 ### Changed diff --git a/README.md b/README.md index 0761abd..21f9bb6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Rich CLI +# Rich-CLI -Rich-cli is a command line toolbox for fancy output in the terminal, built with [Rich](https://github.com/Textualize/rich). +Rich-CLI is a command line toolbox for fancy output in the terminal, built with [Rich](https://github.com/Textualize/rich). Use the `rich` command to highlight a variety of file types in the terminal, with specialized rendering for Markdown and JSON files. Additionally you can markup and format text from the command line. diff --git a/src/rich_cli/__main__.py b/src/rich_cli/__main__.py index 4a5eb32..aa0a068 100644 --- a/src/rich_cli/__main__.py +++ b/src/rich_cli/__main__.py @@ -102,7 +102,7 @@ def read_resource(path: str, lexer: Optional[str]) -> Tuple[str, Optional[str]]: if path == "-": return (sys.stdin.read(), None) - with open(path, "rt") as resource_file: + with open(path, "rt", encoding="utf8", errors="replace") as resource_file: text = resource_file.read() if not lexer: _, dot, ext = path.rpartition(".")