add a while loop to the menu function
This way the script will keep running after a selection in the menu.
This commit is contained in:
parent
7b2caf78f6
commit
78f2584787
|
@ -2,22 +2,22 @@
|
||||||
import os
|
import os
|
||||||
import borg_variables
|
import borg_variables
|
||||||
import sys
|
import sys
|
||||||
|
chosen_activity = 100
|
||||||
# Setting the environment variables
|
# Setting the environment variables
|
||||||
os.environ['BORG_REPO'] = str(borg_variables.repository)
|
os.environ['BORG_REPO'] = str(borg_variables.repository)
|
||||||
os.environ['BORG_PASSPHRASE'] = str(borg_variables.password)
|
os.environ['BORG_PASSPHRASE'] = str(borg_variables.password)
|
||||||
|
while chosen_activity != 0:
|
||||||
print("What would you like to do?")
|
print("What would you like to do?")
|
||||||
# Start the chosen activity and go back to the activity selector.
|
# Start the chosen activity and go back to the activity selector.
|
||||||
print("1: List Backups, 2: Show archive details, 0: Exit")
|
print("1: List Backups, 2: Show archive details, 0: Exit")
|
||||||
try:
|
try:
|
||||||
chosen_activity = int(input("Choose the desired activity:"))
|
chosen_activity = int(input("Choose the desired activity:"))
|
||||||
if chosen_activity == 1:
|
if chosen_activity == 1:
|
||||||
os.system('borg list')
|
os.system('borg list')
|
||||||
if chosen_activity == 2:
|
if chosen_activity == 2:
|
||||||
archive_name = input("Please enter the archive name ")
|
archive_name = input("Please enter the archive name ")
|
||||||
os.system('borg info ::' + archive_name)
|
os.system('borg info ::' + archive_name)
|
||||||
elif chosen_activity == 0:
|
elif chosen_activity == 0:
|
||||||
sys.exit()
|
print()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print("test")
|
print("test")
|
||||||
|
|
Reference in New Issue