1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-09-13 09:09:58 +00:00
Files
python-escpos/src/escpos/codepages.py
Patrick Kanzler 435f2bba24 reformat codebase
2021-10-30 18:15:22 +02:00

25 lines
536 B
Python

from .capabilities import CAPABILITIES
class CodePageManager:
"""Holds information about all the code pages (as defined
in escpos-printer-db).
"""
def __init__(self, data):
self.data = data
def get_all(self):
return self.data.values()
@staticmethod
def get_encoding_name(encoding):
# TODO resolve the encoding alias
return encoding.upper()
def get_encoding(self, encoding):
return self.data[encoding]
CodePages = CodePageManager(CAPABILITIES["encodings"])