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
Executable File

#!/usr/bin/env python3
import interface_functions
import curses
chosen_activity = None
# The main menu starts there
interface_functions.configuration()
while chosen_activity != 0:
interface_functions.draw_menu()
screen = curses.initscr()
try:
chosen_activity = screen.getch()
if chosen_activity == ord('1'):
# prints all the archives in the repository and lists them with
# less
interface_functions.list_archives()
if chosen_activity == ord('2'):
# Displays all the information related to the archive name the user
# enters
interface_functions.show_info()
if chosen_activity == ord('3'):
# mounts a chosen archive to /tmp/archive name
interface_functions.mount_archive()
if chosen_activity == ord('4'):
interface_functions.restore_archive()
if chosen_activity == ord('5'):
interface_functions.delete_archive()
if chosen_activity == ord('6'):
interface_functions.create_archive()
elif chosen_activity == ord('0'):
interface_functions.exit()
except ValueError:
print("Please enter a full number.")