Merge commit '5af0faaa65432db23d391ee65a6fe9f85021f032'
This commit is contained in:
@@ -12,6 +12,7 @@ class SupportedOs:
|
||||
WINDOWS = "windows"
|
||||
LINUX = "linux"
|
||||
MAC = "mac"
|
||||
RASPBIAN = "raspberry"
|
||||
|
||||
|
||||
class Ftype:
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
|
||||
|
||||
@@ -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().lower()
|
||||
|
||||
|
||||
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
|
||||
|
||||
@@ -112,7 +112,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(
|
||||
@@ -127,7 +127,7 @@ class UpdatesController(QObject):
|
||||
logging.error("Unable to query the updater")
|
||||
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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user