refactor: update GPhotoCamera configuration methods for consistency
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from PySide6.QtCore import Signal
|
|
||||||
|
|
||||||
|
|
||||||
class BaseCamera(ABC):
|
class BaseCamera(ABC):
|
||||||
@@ -17,6 +16,22 @@ class BaseCamera(ABC):
|
|||||||
@abstractmethod
|
@abstractmethod
|
||||||
def get_frame(self):
|
def get_frame(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def get_config_by_id(self, id: int) -> dict:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def get_config_by_name(self, name: str) -> dict:
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def set_config_by_id(self, id: int, value: str):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def set_config_by_name(self, name: str, value: str):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def get_error_msg(self):
|
def get_error_msg(self):
|
||||||
return str(self.error_msg)
|
return str(self.error_msg)
|
||||||
|
|||||||
@@ -88,10 +88,10 @@ class GPhotoCamera(BaseCamera):
|
|||||||
|
|
||||||
self.set_config(config, value)
|
self.set_config(config, value)
|
||||||
|
|
||||||
def set_config_by_name(self, name: str):
|
def set_config_by_name(self, name: str, value: str):
|
||||||
config = self.get_config_by_name(name)
|
config = self.get_config_by_name(name)
|
||||||
|
|
||||||
self.set_config(config, name)
|
self.set_config(config, value)
|
||||||
|
|
||||||
def _save_config(self, config):
|
def _save_config(self, config):
|
||||||
if not self.camera:
|
if not self.camera:
|
||||||
|
|||||||
Reference in New Issue
Block a user