-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
64 lines (47 loc) · 1.21 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import os
from backup import BackupTool
def backup(backup_tool):
print("\nBackup")
source = input("Enter source directory: ")
print("\n1. Full Backup")
print("2. Differential Backup")
print("0. Exit")
choice = input("Enter your choice: ").strip()
if choice == "1":
print("Full Backup")
backup_tool.full_backup(source=source)
elif choice == "2":
print("Differential Backup")
backup_tool.differential_backup(source=source)
elif choice == "0":
return
else:
print("Invalid choice")
def restore(backup_tool):
print("\nRestore")
def main():
backup_tool = BackupTool()
# clear the screen
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
cont = True
while cont:
print("""
Welcome to the Backup Tool
1. Backup
2. Restore
0. Exit
""")
choice = input("Enter your choice: ").strip()
if choice == "1":
backup(backup_tool)
elif choice == "2":
restore(backup_tool)
elif choice == "0":
cont = False
else:
print("Invalid choice")
if __name__ == '__main__':
main()