Minor bugfix, compatibility fix

This commit is contained in:
kdmukai
2022-02-25 10:50:36 -06:00
parent 2c85ae8443
commit a4bb77bfd0
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ class Camera(Singleton):
from seedsigner.models import Settings
if cls._instance is None:
cls._instance = cls.__new__(cls)
cls._instance._camera_rotation = Settings.get_instance().get_value(SettingsConstants.SETTING__CAMERA_ROTATION)
cls._instance._camera_rotation = int(Settings.get_instance().get_value(SettingsConstants.SETTING__CAMERA_ROTATION))
return cls._instance
+4 -3
View File
@@ -746,12 +746,13 @@ class SettingsQrDecoder(BaseSingleFrameQrDecoder):
def add(self, segment, qr_type=QRType.SETTINGS):
print(f"SettingsQR: {segment}")
print(f"SettingsQR:\n{segment}")
try:
self.settings = {}
# QR Settings format is space-separated key/value pairs
for entry in segment.split(" "):
# QR Settings format is space-separated key/value pairs, but should also
# parse \n-separated keys.
for entry in segment.split():
key = entry.split("=")[0].strip()
value = entry.split("=")[1].strip()
self.settings[key] = value