E-Paper-Calendar/Calendar/ImageFileAdapter.py

19 lines
516 B
Python
Raw Permalink Normal View History

2019-02-20 20:53:14 +01:00
from DisplayAdapter import DisplayAdapter
2019-04-29 18:14:25 +02:00
from Assets import path
2019-02-20 20:53:14 +01:00
2019-07-13 08:05:35 +02:00
2019-02-20 20:53:14 +01:00
class ImageFileAdapter (DisplayAdapter):
"""Saves design to an image file, can be used for debugging"""
2019-07-13 08:05:35 +02:00
def __init__(self, file_path=""):
super(ImageFileAdapter, self).__init__(384, 640)
2019-02-20 20:53:14 +01:00
self.file_path = file_path
2019-04-29 18:14:25 +02:00
if self.file_path == "":
self.file_path = path
2019-02-20 20:53:14 +01:00
2019-07-13 08:05:35 +02:00
def render(self, design):
design.get_image().save(self.file_path + 'design_exported.png')
2019-02-20 20:53:14 +01:00
2019-07-13 08:05:35 +02:00
def calibrate(self):
pass