flake8 compliance
This commit is contained in:
@@ -54,8 +54,8 @@ class Photobooth:
|
|||||||
self._cap = camera
|
self._cap = camera
|
||||||
self._pic_dims = PictureDimensions(config, self._cap.getPicture().size)
|
self._pic_dims = PictureDimensions(config, self._cap.getPicture().size)
|
||||||
|
|
||||||
if (config.getBool('Photobooth', 'show_preview')
|
if (config.getBool('Photobooth', 'show_preview') and
|
||||||
and self._cap.hasPreview):
|
self._cap.hasPreview):
|
||||||
logging.info('Countdown with preview activated')
|
logging.info('Countdown with preview activated')
|
||||||
self._show_counter = self.showCountdownPreview
|
self._show_counter = self.showCountdownPreview
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ class CameraGphoto2Cffi(Camera):
|
|||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
|
|
||||||
self._cap.config['imgsettings']['imageformat'].set(self._imageformat)
|
self._cap.config['imgsettings']['imageformat'].set(self._imgfmt)
|
||||||
self._cap.config['imgsettings']['imageformatsd'].set(self._imageformatsd)
|
self._cap.config['imgsettings']['imageformatsd'].set(self._imgfmtsd)
|
||||||
# self._cap.config['settings']['autopoweroff'].set(self._autopoweroff)
|
# self._cap.config['settings']['autopoweroff'].set(self._autopoweroff)
|
||||||
|
|
||||||
def _setupCamera(self):
|
def _setupCamera(self):
|
||||||
@@ -53,16 +53,18 @@ class CameraGphoto2Cffi(Camera):
|
|||||||
self._cap.supported_operations)
|
self._cap.supported_operations)
|
||||||
|
|
||||||
# make sure camera format is not set to raw
|
# make sure camera format is not set to raw
|
||||||
self._imageformat = self._cap.config['imgsettings']['imageformat'].value
|
imgfmt = 'Large Fine JPEG'
|
||||||
if 'raw' in self._imageformat.lower():
|
self._imgfmt = self._cap.config['imgsettings']['imageformat'].value
|
||||||
self._cap.config['imgsettings']['imageformat'].set('Large Fine JPEG')
|
if 'raw' in self._imgfmt.lower():
|
||||||
self._imageformatsd = self._cap.config['imgsettings']['imageformatsd'].value
|
self._cap.config['imgsettings']['imageformat'].set(imgfmt)
|
||||||
if 'raw' in self._imageformatsd.lower():
|
self._imgfmtsd = self._cap.config['imgsettings']['imageformatsd'].value
|
||||||
self._cap.config['imgsettings']['imageformatsd'].set('Large Fine JPEG')
|
if 'raw' in self._imgfmtsd.lower():
|
||||||
|
self._cap.config['imgsettings']['imageformatsd'].set(imgfmt)
|
||||||
|
|
||||||
# make sure autopoweroff is disabled
|
# make sure autopoweroff is disabled
|
||||||
# this doesn't seem to work
|
# this doesn't seem to work
|
||||||
# self._autopoweroff = int(self._cap.config['settings']['autopoweroff'].value)
|
# self._autopoweroff = int(
|
||||||
|
# self._cap.config['settings']['autopoweroff'].value)
|
||||||
# if self._autopoweroff > 0:
|
# if self._autopoweroff > 0:
|
||||||
# self._cap.config['settings']['autopoweroff'].set("0")
|
# self._cap.config['settings']['autopoweroff'].set("0")
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,6 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import queue
|
|
||||||
|
|
||||||
from .. import printer
|
from .. import printer
|
||||||
from ..util import lookup_and_import
|
from ..util import lookup_and_import
|
||||||
|
|
||||||
@@ -30,13 +28,12 @@ class GuiPostprocessor:
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
self._task_list = []
|
self._task_list = []
|
||||||
self._queue = queue.Queue()
|
|
||||||
|
|
||||||
if config.getBool('Printer', 'enable'):
|
if config.getBool('Printer', 'enable'):
|
||||||
module = config.get('Printer', 'module')
|
module = config.get('Printer', 'module')
|
||||||
size = (config.getInt('Printer', 'width'),
|
paper_size = (config.getInt('Printer', 'width'),
|
||||||
config.getInt('Printer', 'height'))
|
config.getInt('Printer', 'height'))
|
||||||
self._task_list.append(PrintPostprocess(module, size))
|
self._task_list.append(PrintPostprocess(module, paper_size))
|
||||||
|
|
||||||
def get(self, picture):
|
def get(self, picture):
|
||||||
|
|
||||||
@@ -92,12 +89,12 @@ class PostprocessItem:
|
|||||||
|
|
||||||
class PrintPostprocess(PostprocessTask):
|
class PrintPostprocess(PostprocessTask):
|
||||||
|
|
||||||
def __init__(self, printer_module, page_size, **kwargs):
|
def __init__(self, printer_module, paper_size, **kwargs):
|
||||||
|
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
Printer = lookup_and_import(printer.modules, printer_module, 'printer')
|
Printer = lookup_and_import(printer.modules, printer_module, 'printer')
|
||||||
self._printer = Printer(page_size, True)
|
self._printer = Printer(paper_size, True)
|
||||||
|
|
||||||
def get(self, picture):
|
def get(self, picture):
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from . import GuiState # noqa
|
from . import GuiState # noqa
|
||||||
|
|
||||||
# Available gui modules as tuples of (config name, module name, class name)
|
# Available gui modules as tuples of (config name, module name, class name)
|
||||||
modules = (('PyQt5', 'Qt5Gui', 'PyQt5Gui'), )
|
modules = (('PyQt5', 'Qt5Gui', 'PyQt5Gui'), )
|
||||||
|
|||||||
Reference in New Issue
Block a user