1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-06-25 08:38:43 +00:00
python-escpos/src/escpos/codepages.py
dependabot[bot] 7d42f11716
Bump sphinx-rtd-theme from 2.0.0 to 3.0.1 (#661)
* Bump sphinx-rtd-theme from 2.0.0 to 3.0.1

Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 2.0.0 to 3.0.1.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/2.0.0...3.0.1)

---
updated-dependencies:
- dependency-name: sphinx-rtd-theme
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* remove call to get_html_theme_path

according to deprection warning of sphinx-rtd-theme>=3

* disable broken spelling integration (pypi) and fix spelling

* fix spelling

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Patrick Kanzler <dev@pkanzler.de>
2024-10-10 15:00:28 +02:00

29 lines
665 B
Python

"""Helper module for code page handling."""
from .capabilities import CAPABILITIES
class CodePageManager:
"""Holds information about all the code pages.
Information as defined in escpos-printer-db.
"""
def __init__(self, data):
"""Initialize code page manager."""
self.data = data
@staticmethod
def get_encoding_name(encoding):
"""Get encoding name.
.. todo:: Resolve the encoding alias.
"""
return encoding.upper()
def get_encoding(self, encoding):
"""Return the encoding data."""
return self.data[encoding]
CodePages = CodePageManager(CAPABILITIES["encodings"])