File size: 1,405 Bytes
0ed3eb7 8a99355 e2b0ccc a8a5881 e2b0ccc 3ad592f 8a99355 a8a5881 3ad592f bad687a 0ed3eb7 bad687a 3a4f8c4 bad687a |
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 |
import os
import sys
# Dynamically add the correct project root path to Python's module search path
project_root = os.path.abspath(os.path.dirname(__file__))
nested_project_root = os.path.join(project_root, "nagasurendra", "restaurant-ordering-system")
# Add both root paths to sys.path
if nested_project_root not in sys.path:
sys.path.insert(0, nested_project_root)
if project_root not in sys.path:
sys.path.insert(0, project_root)
# Debugging: Verify the paths
print("DEBUG: sys.path =", sys.path)
print("DEBUG: Does 'routes' directory exist? ", os.path.exists(os.path.join(nested_project_root, "routes")))
print("DEBUG: Does 'auth.py' exist in 'routes'? ", os.path.exists(os.path.join(nested_project_root, "routes", "auth.py")))
# Import modules
try:
from routes.auth import login, sign_up
from routes.menu import load_menu
from routes.orders import add_to_order, view_order, place_order
from utils.file_initializer import initialize_files
except ModuleNotFoundError as e:
print(f"ERROR: {e}")
print("DEBUG: ModuleNotFoundError occurred. Check the paths and file structure.")
sys.exit(1)
# Initialize necessary files
initialize_files()
def restaurant_interface():
from gradio import Blocks
with Blocks() as app:
app.load_page("templates/index.html")
return app
if __name__ == "__main__":
app = restaurant_interface()
app.launch()
|