Fix a bug in the *.spec files and also apply the following major changes:
- Add support for adding the base folder to PATH. - Only display one pop up window at a time in order to avoid confusion. - Add automatic updates feature: - Windows and Linux versions will be shipped with an updater program used to update both Artemis and the updater itself. - MacOs versions will not have the updater. Instead the user will be asked to download the new software version (if present) via browser.
This commit is contained in:
34
src/os_utilities.py
Normal file
34
src/os_utilities.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import sys
|
||||
from constants import SupportedOs
|
||||
|
||||
|
||||
def _is_mac_os():
|
||||
"""Return True if running OS is Mac."""
|
||||
return sys.platform == 'darwin'
|
||||
|
||||
|
||||
def _is_win_os():
|
||||
"""Return True if running OS is Windows."""
|
||||
return sys.platform == 'win32'
|
||||
|
||||
|
||||
def _is_linux_os():
|
||||
"""Return True if running OS is Linux."""
|
||||
return sys.platform == 'linux'
|
||||
|
||||
|
||||
IS_MAC = _is_mac_os()
|
||||
IS_LINUX = _is_linux_os()
|
||||
IS_WINDOWS = _is_win_os()
|
||||
|
||||
|
||||
def get_os():
|
||||
"""Get the name of the current running operating system."""
|
||||
if IS_WINDOWS:
|
||||
return SupportedOs.WINDOWS
|
||||
elif IS_LINUX:
|
||||
return SupportedOs.LINUX
|
||||
elif IS_MAC:
|
||||
return SupportedOs.MAC
|
||||
else:
|
||||
raise Exception("ERROR: OS not recognized.")
|
||||
Reference in New Issue
Block a user