Files
ai-game-2/tools/ora_editor/app.py
Bryce fb812e57bc Restructure ORA editor into modular blueprints with browse dialog
- Split app.py into route blueprints (files, layers, images, polygon, mask, krita)
- Create services layer (polygon_storage, comfyui, file_browser)
- Extract config constants to config.py
- Split templates into Jinja partials (base, components, modals)
- Add browse dialog for visual file navigation
- Add /api/browse endpoint for directory listing
2026-03-27 21:29:27 -07:00

41 lines
942 B
Python

#!/usr/bin/env python3
"""Flask web application for ORA editing."""
import logging
import sys
from pathlib import Path
from flask import Flask, render_template
# Ensure the package can be imported
sys.path.insert(0, str(Path(__file__).parent.parent))
from ora_editor.config import TEMP_DIR
from ora_editor.routes import (
files_bp, layers_bp, images_bp, polygon_bp, mask_bp, krita_bp
)
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
app = Flask(__name__, template_folder='templates')
@app.route('/')
def index():
"""Serve the main editor UI."""
return render_template('editor.html')
# Register blueprints
app.register_blueprint(files_bp)
app.register_blueprint(layers_bp)
app.register_blueprint(images_bp)
app.register_blueprint(polygon_bp)
app.register_blueprint(mask_bp)
app.register_blueprint(krita_bp)
if __name__ == '__main__':
app.run(debug=False, port=5001, host='127.0.0.1')