diff --git a/src/constants.py b/src/constants.py index cbc5b8c..76a0549 100644 --- a/src/constants.py +++ b/src/constants.py @@ -12,6 +12,7 @@ class SupportedOs: WINDOWS = "windows" LINUX = "linux" MAC = "mac" + RASPBIAN = "raspberry" class Ftype: diff --git a/src/downloadtargetfactory.py b/src/downloadtargetfactory.py index 97927de..631e938 100644 --- a/src/downloadtargetfactory.py +++ b/src/downloadtargetfactory.py @@ -49,6 +49,7 @@ class _TarExtractor: EXTRACTORS = { SupportedOs.WINDOWS: _ZipExtractor, SupportedOs.LINUX: _TarExtractor, + SupportedOs.RASPBIAN: _TarExtractor, # No extractor for MacOs, just download the file through the browser. } diff --git a/src/os_utilities.py b/src/os_utilities.py index 1aa42a6..a8bed3b 100644 --- a/src/os_utilities.py +++ b/src/os_utilities.py @@ -1,4 +1,5 @@ import sys +import platform from constants import SupportedOs @@ -20,6 +21,7 @@ def _is_linux_os(): IS_MAC = _is_mac_os() IS_LINUX = _is_linux_os() IS_WINDOWS = _is_win_os() +IS_RASPBIAN = IS_LINUX and 'arm' in platform.machine().lowercase() def get_os(): @@ -27,8 +29,10 @@ def get_os(): if IS_WINDOWS: return SupportedOs.WINDOWS elif IS_LINUX: + if IS_RASPBIAN: + return SupportedOs.RASPBIAN return SupportedOs.LINUX elif IS_MAC: return SupportedOs.MAC else: - raise Exception("ERROR: OS not recognized.") + return None diff --git a/src/updatescontroller.py b/src/updatescontroller.py index d87baf7..abb761d 100644 --- a/src/updatescontroller.py +++ b/src/updatescontroller.py @@ -110,7 +110,7 @@ class UpdatesController(QObject): If so, ask to download the new version. If the software is not a compiled version, the function is a NOP.""" if not IS_BINARY or IS_MAC: - return + return None latest_updater_version = self.version_controller.updater.version try: with sp.Popen( @@ -124,7 +124,7 @@ class UpdatesController(QObject): except Exception: updater_version = latest_updater_version if latest_updater_version is None: - return + return None if updater_version != latest_updater_version: answer = pop_up( self._owner, diff --git a/src/versioncontroller.py b/src/versioncontroller.py index 5712083..3878f3f 100644 --- a/src/versioncontroller.py +++ b/src/versioncontroller.py @@ -61,6 +61,20 @@ def _download_versions_file(): "size": ... } } + "raspberry": { + "software": { + "version": "...", + "url": "...", + "hash_code": "...", + "size": ... + }, + "updater": { + "version": "...", + "url": "...", + "hash_code": "...", + "size": ... + } + } } """ return json.load(