Installing necessary PySide2 package for GUI-mode

This commit is contained in:
Paul S 2021-05-07 13:16:13 +02:00
parent 8e7afcedce
commit 5852ac6b62
3 changed files with 6 additions and 7 deletions

View file

@ -3,6 +3,7 @@
## [0.8] - 2021-05-07 ## [0.8] - 2021-05-07
### Added ### Added
- Introduce "Browse"-button on directory-selection dialogs - Introduce "Browse"-button on directory-selection dialogs
- Installing necessary PySide2 package for GUI-mode if not existing
## [0.7] - 2021-05-06 ## [0.7] - 2021-05-06
### Added ### Added

View file

@ -35,10 +35,6 @@ def set_language(language):
global LANGUAGE global LANGUAGE
LANGUAGE = language LANGUAGE = language
def set_exclude(exclude_flag):
global EXCLUDE
EXCLUDE = exclude_flag
def trace(message_txt): def trace(message_txt):
""" Print a formatted message to std out. """ """ Print a formatted message to std out. """
print("[ OK ] " + message_txt) print("[ OK ] " + message_txt)
@ -73,11 +69,12 @@ def main_install_cli():
# asks if you want to exclude files/directories from backup and creates an exclude file in case of Yes # asks if you want to exclude files/directories from backup and creates an exclude file in case of Yes
exclude = input(get_lang_text("excludefile1") + "\n> ") exclude = input(get_lang_text("excludefile1") + "\n> ")
global EXCLUDE
if exclude.upper() in ("J", "Y"): if exclude.upper() in ("J", "Y"):
set_exclude(True) EXCLUDE = True
print(get_lang_text("excludefile2") + "\n") print(get_lang_text("excludefile2") + "\n")
else: else:
set_exclude(False) EXCLUDE = False
print(get_lang_text("excludefile3") + "\n") print(get_lang_text("excludefile3") + "\n")
time.sleep(1) time.sleep(1)
@ -167,7 +164,7 @@ def main(argv):
if argv and argv[0] == "--gui": if argv and argv[0] == "--gui":
from install_gui import main_install_gui from install_gui import main_install_gui
trace("Starting GUI-version.\n") trace("Starting GUI-version.")
is_finalized, is_exclude, rsync_cmd = main_install_gui() # collect user input via GUI and store in env. variables is_finalized, is_exclude, rsync_cmd = main_install_gui() # collect user input via GUI and store in env. variables
else: else:

View file

@ -18,6 +18,7 @@ if [ "$1" == "--gui" ]; then
if ! pip list | grep PySide2> /dev/null if ! pip list | grep PySide2> /dev/null
then then
# Install PySide2 # Install PySide2
echo -e "Installing necessary PySide2 package for GUI-mode."
pip3 install PySide2 pip3 install PySide2
fi fi
# Launch python installer in GUI mode # Launch python installer in GUI mode