-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (29 loc) · 896 Bytes
/
main.py
File metadata and controls
36 lines (29 loc) · 896 Bytes
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
import sys
from academic_manager.core import AcademicManager
def main():
"""
The main entry point of the application.
Modes:
python main.py - Interactive CLI mode.
python main.py --web - Start the FastAPI web server.
:raises KeyboardInterrupt: When the user manually interrupts the CLI with Ctrl+C.
"""
if "--web" in sys.argv:
import uvicorn
print("🌐 Iniciando Academic Manager no modo Web...")
print(" Acesse: http://localhost:8000")
print(" Docs: http://localhost:8000/docs")
uvicorn.run(
"api.main:app",
host="0.0.0.0",
port=8000,
reload=True,
log_level="info",
)
return
try:
AcademicManager().run()
except KeyboardInterrupt:
print("Interrompido pelo usuário.")
if __name__ == "__main__":
main()