feat: allow klipper installation with python3

Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
th33xitus
2022-04-12 20:35:41 +02:00
parent 07af423fa3
commit 46510f2b22
3 changed files with 77 additions and 23 deletions

View File

@@ -11,7 +11,7 @@
set -e
install_ui(){
function install_ui(){
top_border
echo -e "| ${green}~~~~~~~~~~~ [ Installation Menu ] ~~~~~~~~~~~${white} | "
hr
@@ -32,13 +32,16 @@ install_ui(){
back_footer
}
install_menu(){
do_action "" "install_ui"
function install_menu(){
clear && print_header
install_ui
while true; do
read -p "${cyan}Perform action:${white} " action; echo
case "$action" in
1)
do_action "klipper_setup_dialog" "install_ui";;
case "${action}" in
1)clear && print_header
select_klipper_python_version
install_ui;;
2)
do_action "moonraker_setup_dialog" "install_ui";;
3)
@@ -63,3 +66,33 @@ install_menu(){
done
install_menu
}
function select_klipper_python_version(){
top_border
echo -e "| Please select the preferred Python version. | "
echo -e "| The recommended version is Python 2.7. | "
blank_line
echo -e "| Installing Klipper with Python 3 is officially not | "
echo -e "| recommended and should be considered as experimental. | "
hr
echo -e "| 1) [Python 2.7] (recommended) | "
echo -e "| 2) [Python 3.x] ${yellow}(experimental)${white} | "
back_footer
while true; do
read -p "${cyan}###### Select Python version:${white} " action; echo
case "${action}" in
1)
select_msg "Python 2.7"
klipper_setup_dialog "python2"
break;;
2)
select_msg "Python 3.x"
klipper_setup_dialog "python3"
break;;
B|b)
clear; install_menu; break;;
*)
error_msg "Invalid Input!\n";;
esac
done
}