mirror of
https://github.com/python-escpos/python-escpos
synced 2025-09-13 09:09:58 +00:00
Port to current version of escpos-printer-db.
This commit is contained in:
@@ -7,8 +7,9 @@ import yaml
|
||||
# Load external printer database
|
||||
with open(path.join(path.dirname(__file__), 'capabilities.json')) as f:
|
||||
CAPABILITIES = yaml.load(f)
|
||||
|
||||
PROFILES = CAPABILITIES['profiles']
|
||||
ENCODINGS = CAPABILITIES['encodings']
|
||||
|
||||
|
||||
|
||||
class NotSupported(Exception):
|
||||
@@ -51,6 +52,12 @@ class BaseProfile(object):
|
||||
"""
|
||||
return self.features.get(feature)
|
||||
|
||||
def get_code_pages(self):
|
||||
"""Return the support code pages as a {name: index} dict.
|
||||
"""
|
||||
return {v.lower(): k for k, v in self.codePages.items()}
|
||||
|
||||
|
||||
|
||||
def get_profile(name=None, **kwargs):
|
||||
"""Get the profile by name; if no name is given, return the
|
||||
|
Reference in New Issue
Block a user