2016-12-13 19:59:17 +01:00
|
|
|
#!/usr/bin/env python3
|
2016-12-13 22:49:17 +01:00
|
|
|
import interface_functions
|
2016-12-16 00:06:27 +01:00
|
|
|
import curses
|
2016-12-17 20:05:35 +01:00
|
|
|
|
2016-12-13 19:59:17 +01:00
|
|
|
chosen_activity = None
|
|
|
|
|
|
|
|
# The main menu starts there
|
2016-12-13 22:49:17 +01:00
|
|
|
interface_functions.configuration()
|
2016-12-13 19:59:17 +01:00
|
|
|
while chosen_activity != 0:
|
2016-12-16 13:13:58 +01:00
|
|
|
interface_functions.draw_menu()
|
2016-12-16 00:06:27 +01:00
|
|
|
screen = curses.initscr()
|
2016-12-13 19:59:17 +01:00
|
|
|
try:
|
2016-12-16 00:06:27 +01:00
|
|
|
chosen_activity = screen.getch()
|
|
|
|
if chosen_activity == ord('1'):
|
2016-12-13 19:59:17 +01:00
|
|
|
# prints all the archives in the repository and lists them with
|
|
|
|
# less
|
2016-12-13 22:49:17 +01:00
|
|
|
interface_functions.list_archives()
|
2016-12-16 00:06:27 +01:00
|
|
|
if chosen_activity == ord('2'):
|
2017-06-10 10:29:12 +02:00
|
|
|
# Displays all the information related to the archive name the user
|
2016-12-13 19:59:17 +01:00
|
|
|
# enters
|
2016-12-13 22:49:17 +01:00
|
|
|
interface_functions.show_info()
|
2016-12-16 00:06:27 +01:00
|
|
|
if chosen_activity == ord('3'):
|
2016-12-13 19:59:17 +01:00
|
|
|
# mounts a chosen archive to /tmp/archive name
|
2016-12-13 22:49:17 +01:00
|
|
|
interface_functions.mount_archive()
|
2016-12-16 00:06:27 +01:00
|
|
|
if chosen_activity == ord('4'):
|
2016-12-17 20:05:35 +01:00
|
|
|
interface_functions.restore_archive()
|
2016-12-17 11:07:50 +01:00
|
|
|
if chosen_activity == ord('5'):
|
2016-12-17 20:05:35 +01:00
|
|
|
interface_functions.delete_archive()
|
2016-12-17 11:07:50 +01:00
|
|
|
if chosen_activity == ord('6'):
|
2016-12-17 20:05:35 +01:00
|
|
|
interface_functions.create_archive()
|
2016-12-16 00:06:27 +01:00
|
|
|
elif chosen_activity == ord('0'):
|
2016-12-17 20:05:35 +01:00
|
|
|
interface_functions.exit()
|
2016-12-13 19:59:17 +01:00
|
|
|
except ValueError:
|
|
|
|
print("Please enter a full number.")
|