This repository has been archived on 2020-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
borg_interface/borg_interface/main.py

35 lines
1.2 KiB
Python
Raw Permalink Normal View History

2016-12-13 19:59:17 +01:00
#!/usr/bin/env python3
2016-12-13 22:49:17 +01:00
import interface_functions
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()
screen = curses.initscr()
2016-12-13 19:59:17 +01:00
try:
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()
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()
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()
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()
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.")