-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
35 lines (28 loc) · 983 Bytes
/
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
import tkinter as tk
from tkinter import filedialog
import MapDesign
import os
def get_campus_and_building():
root = tk.Tk()
root.withdraw()
building_folder = filedialog.askdirectory(
title="Select Building Folder"
)
if not building_folder:
print("No folder selected.")
return None, None
building_name = os.path.basename(building_folder).title()
campus_name = os.path.basename(os.path.dirname(building_folder)).title()
return campus_name, building_name
if __name__ == '__main__':
campus, building = get_campus_and_building()
print(f'Selected {building} in {campus}'+ '\n')
print(f'Fetching {building} data....')
# building = 'Athabasca Hall'
# campus = 'North Campus'
if campus and building:
print("Building User interface....." + "\n")
app = MapDesign.Application(building, campus)
app.mainloop()
else:
print("Application exited without selecting a folder.")