mirror of
https://github.com/python-escpos/python-escpos
synced 2025-09-13 09:09:58 +00:00
improve platform independence (#296)
* add os.devnull for platform independence fixes #288 * add test for soft_barcode * open devnull as binary * add version identifier to pickle
This commit is contained in:
@@ -8,12 +8,13 @@ import six
|
||||
import yaml
|
||||
|
||||
from tempfile import gettempdir
|
||||
import platform
|
||||
|
||||
logging.basicConfig()
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
pickle_dir = environ.get('ESCPOS_CAPABILITIES_PICKLE_DIR', gettempdir())
|
||||
pickle_path = path.join(pickle_dir, 'capabilities.pickle')
|
||||
pickle_path = path.join(pickle_dir, '{v}.capabilities.pickle'.format(v=platform.python_version()))
|
||||
capabilities_path = environ.get(
|
||||
'ESCPOS_CAPABILITIES_FILE',
|
||||
path.join(path.dirname(__file__), 'capabilities.json'))
|
||||
|
Reference in New Issue
Block a user