CoolFace
Apppublic

hackless123/gmail_sys

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
main.py36 linesDownload Raw Back to app
1import os2import sys3 4# Add the current working directory to the path so it can find the 'app' module5sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))6 7try:8    from openenv import OpenEnvServer9except ImportError:10    print("⚠️ OpenEnv SDK not found. This is expected in local build.")11    OpenEnvServer = None12 13# Now this import will work!14from app.engine import GmailEnvironment15 16def main():17    port = int(os.environ.get("PORT", 8000))18    19    if OpenEnvServer is None:20        print("❌ Cannot start server: OpenEnvServer is not installed.")21        # Keeping the container alive so you can see the logs22        import time23        while True:24            time.sleep(10)25 26    server = OpenEnvServer(27        env_class=GmailEnvironment,28        host="0.0.0.0",29        port=port30    )31    32    print(f"🚀 Gmail Management Env running on port {port}...")33    server.run()34 35if __name__ == "__main__":36    main()