pax_global_header00006660000000000000000000000064146304304320014511gustar00rootroot0000000000000052 comment=92f4aa8f4d8605eff70b34bf5f4fd2754e7d1611 term-image-0.7.2/000077500000000000000000000000001463043043200135465ustar00rootroot00000000000000term-image-0.7.2/.flake8000066400000000000000000000002631463043043200147220ustar00rootroot00000000000000[flake8] max_line_length = 88 extend_ignore = E203 extend_exclude = .venv,build count = True color = auto show_source = True statistics = True per-file-ignores = tests/*:F403 term-image-0.7.2/.github/000077500000000000000000000000001463043043200151065ustar00rootroot00000000000000term-image-0.7.2/.github/FUNDING.yml000066400000000000000000000000651463043043200167240ustar00rootroot00000000000000custom: ['https://www.buymeacoffee.com/anonymoux47'] term-image-0.7.2/.github/ISSUE_TEMPLATE/000077500000000000000000000000001463043043200172715ustar00rootroot00000000000000term-image-0.7.2/.github/ISSUE_TEMPLATE/bug_report.md000066400000000000000000000020451463043043200217640ustar00rootroot00000000000000--- name: Bug Report about: Create a report to help us fix a bug title: '' labels: bug assignees: '' --- **Description** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information, if applicable):** - OS: [e.g. Ubuntu] - Version [e.g. 21.10] - Kernel version (if applicable) [e.g Linux 5.14] **Smartphone (please complete the following information, if applicable):** - Device: [e.g. Samsumg S20] - OS: [e.g. Android] - Version [e.g. 9 (Pie)] **Package info:** - Python version: [e.g 3.9.5] - Package version: [e.g 1.2.3] - Installation method: [e.g PyPI, from source] **Terminal Emulator:** - Name: [e.g Gnome Terminal, Kitty, iTerm2] - Version: **Additional context** Add any other context about the problem here. term-image-0.7.2/.github/ISSUE_TEMPLATE/critical_bug.md000066400000000000000000000021011463043043200222340ustar00rootroot00000000000000--- name: Critical Bug about: Issues that should be fixed with utmost priority title: '' labels: critical assignees: AnonymouX47 --- **Description** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information, if applicable):** - OS: [e.g. Ubuntu] - Version [e.g. 21.10] - Kernel version (if applicable) [e.g Linux 5.14] **Smartphone (please complete the following information, if applicable):** - Device: [e.g. Samsumg S20] - OS: [e.g. Android] - Version [e.g. 9 (Pie)] **Package info:** - Python version: [e.g 3.9.5] - Package version: [e.g 1.2.3] - Installation method: [e.g PyPI, from source] **Terminal Emulator:** - Name: [e.g Gnome Terminal, Kitty, iTerm2] - Version: **Additional context** Add any other context about the problem here. term-image-0.7.2/.github/ISSUE_TEMPLATE/feature_suggestion.md000066400000000000000000000011441463043043200235150ustar00rootroot00000000000000--- name: Feature Suggestion about: Suggest an idea for this project title: '' labels: enhancement assignees: '' --- **Is your feature suggestion related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the suggested feature here. term-image-0.7.2/.github/workflows/000077500000000000000000000000001463043043200171435ustar00rootroot00000000000000term-image-0.7.2/.github/workflows/build.yml000066400000000000000000000014671463043043200207750ustar00rootroot00000000000000# This workflow will build and install the package with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: build on: push: branches: [ main ] pull_request: jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Test package build and installation run: | make build pip install -I dist/*.whl pip install -I dist/*.tar.gz term-image-0.7.2/.github/workflows/format_check.yml000066400000000000000000000015541463043043200223200ustar00rootroot00000000000000# This workflow will install Python dependencies and check formatting with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: format check on: push: branches: [ main ] pull_request: jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: make install-req - name: Check formatting with black run: make check-format - name: Check imports formatting with isort run: make check-imports term-image-0.7.2/.github/workflows/lint.yml000066400000000000000000000016631463043043200206420ustar00rootroot00000000000000# This workflow will install Python dependencies and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: lint on: push: branches: [ main ] pull_request: jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: make install-req - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # Extended checks make lint term-image-0.7.2/.github/workflows/test.yml000066400000000000000000000014741463043043200206530ustar00rootroot00000000000000# This workflow will install the package and dev dependencies and run tests with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: test on: push: branches: [ main ] pull_request: jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install the package and dev dependencies run: make install - name: Test with pytest run: make test-all term-image-0.7.2/.gitignore000066400000000000000000000007251463043043200155420ustar00rootroot00000000000000# NOTE: # Only entries directly pertaining to the project should be added here. # Anything specific to your development process, environemnt or IDE should be ignored locally # i.e from "$GIT_DIR/info/exclude", "~/.config/git/ignore" or "$XDG_CONFIG_HOME/git/ignore", etc. # It helps to keep things simple, thanks. # Python module cache __pycache__/ # Distribution/Packaging build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ sdist/ wheels/ *.egg-info/ *.egg MANIFEST term-image-0.7.2/.readthedocs.yaml000066400000000000000000000011201463043043200167670ustar00rootroot00000000000000# Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details # Required version: 2 # Set the version of Python and other tools you might need build: os: ubuntu-20.04 tools: python: "3.9" # Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/source/conf.py fail_on_warning: true formats: - htmlzip - pdf # Optionally declare the Python requirements required to build your docs python: install: # For `autodoc` - method: pip path: . - requirements: docs/requirements.txt term-image-0.7.2/CHANGELOG.md000066400000000000000000000730201463043043200153610ustar00rootroot00000000000000# Changelog 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] ## [0.7.2] - 2024-06-06 ### Added - indexed-color (256-color) rendering for `BlockImage` ([#109]). - `DIRECT` and `INDEXED` render methods. - *method* style-specific render parameter and format spec field. [#109]: https://github.com/AnonymouX47/term-image/pull/109 ## [0.7.1] - 2023-02-10 ### Fixed - Undefined references in some top-level functions ([497d9b7], [4e8b3e7]). - Formatting of some `ValueError` exception messages ([d296a31]). - Typos in docs and comments ([#98]) by [**@kianmeng**](https://github.com/kianmeng). - `UnboundLocalError` in `term_image.utils.get_cell_size()` when ioctl fails and queries are disabled ([e12ffa8], [#104]). ### Added - Support for Pillow v10 ([8cfebe2]). [#98]: https://github.com/AnonymouX47/term-image/pull/98 [#104]: https://github.com/AnonymouX47/term-image/pull/104 [497d9b7]: https://github.com/AnonymouX47/term-image/commit/497d9b70dd74605e6589b81bea2fcac22efc684b [d296a31]: https://github.com/AnonymouX47/term-image/commit/d296a3110882449f6717959400abbc5fa1bd0891 [4e8b3e7]: https://github.com/AnonymouX47/term-image/commit/4e8b3e7cf39e9e96fc38532d69d498938db54f3e [8cfebe2]: https://github.com/AnonymouX47/term-image/commit/8cfebe27b63dcdd987fc9d0c71616e76777779a9 [e12ffa8]: https://github.com/AnonymouX47/term-image/commit/e12ffa818eb06f78cb586504ccc1c58df1fab90e ## [0.7.0] - 2023-06-05 ### Fixed - Jagged edges with `LINES` render method of kitty and iterm2 render styles ([4d27055]). ### Added - `UrwidImageScreen.clear_images()` ([08f4e4d], [8b895ce]). - `term_image.utils.get_cell_size()` to the public API ([#87]). - Support for terminal size-relative frame sizes ([#89]). - Manual sizing ([#89]). - Allows setting both width and height explicitly via: - `BaseImage.set_size()` - `BaseImage.size` - Support for terminal size-relative padding ([#91]). - `ANIM` render method to the `iterm2` render style ([#92]). - `term_image.exceptions.RenderError` ([#94]). ### Changed - `KeyboardInterrupt` is no longer raised when `SIGINT` is used to end an animation ([fa47742]). - `UrwidImageScreen.clear()` now clears images also ([ed3baa3]). - Improved terminal cell size computation ([#87]). - **(BREAKING!)** `InvalidSizeError` no longer inherits from `ValueError` ([26ea969]). - **(BREAKING!)** `UrwidImage` now raises `UrwidImageError` instead of `ValueError` when rendered as a fixed widget ([a612b59]). - **(BREAKING!)** Setting image size with `Size.FIT_TO_WIDTH` no longer influences size validation ([#89]). - **(BREAKING!)** Redefined `BaseImage.set_size()` ([#89]). - Now allows specifying both *width* and *height* but only as integers. - No longer raises `ValueError`. - Now raises `TypeError` when both *width* and *height* are not `None` but not both are integers. - Redefined the *maxsize* parameter as *frame_size*. - No longer accepts `None`. - Now accepts non-positive integer tuple elements. - No longer raises `ValueError`: Available size too small. - No longer checks if the resulting size fits into a given frame size when *width* or *height* is also given as an integer. - No longer raises `InvalidSizeError`. - **(BREAKING!)** Redefined *pad_width* and *pad_height* formatting parameters ([#91]). - No longer accept `None`. - Now accept non-positive integers. - Changed default values to `0` and `-2` respectively. - **(BREAKING!)** Changed `N` to `A` in the *method* field of the `iterm2` style-speific render format specification ([#92]). - **(BREAKING!)** `term_image.exceptions.StyleError` is now raised instead of style-specific exceptions ([#93]). - **(BREAKING!)** `term_image.exceptions.RenderError` is now raised for errors that occur during rendering ([#94]). - **(BREAKING!)** `BaseImage.forced_support` can no longer be set via instances ([#95]). - **(BREAKING!)** `ITerm2Image.native_anim_max_bytes` can no longer be set or deleted via instances ([#95]). ### Removed - `UrwidImage.clear_all()` ([08f4e4d]) and `UrwidImage.clear()` ([8b895ce]). - Replaced by `UrwidImageScreen.clear_images()`. - Image scaling ([#88]). - *scale* parameter of `BaseImage`, `BaseImage.from_file()`, `BaseImage.from_url()`, etc. - `scale`, `scale_x` and `scale_y` properties of `BaseImage`. - Replaced by manual sizing ([#89]). - Image sizing allowance ([#89]). - *h_allow* and *v_allow* parameters of `BaseImage.set_size()`. - Replaced by terminal size-relative frame sizes ([#89]) and padding ([#91]). - *native* and *stall_native* `iterm2` style-specific render parameters ([#92]). - Replaced by the `ANIM` render method. - Style-specific exceptions ([#93]). - `GraphicsImageError` - `TextImageError` - `BlockImageError` - `ITerm2ImageError` - `KittyImageError` - Render style name property and custom render style class string representation ([7d673dd]). - `