masklinn  committed 16dc743

Remove moving around of Flask static files and templates

need to fixup later for better unification, but for now aim is to remove/clarify usage of flask

  • Participants
  • Parent commits 4b24a47
  • Branches default

Comments (0)

Files changed (2)

-# copy resources from this webapp
-for name in ['static', 'templates']:
-    source_dir = os.path.join(os.getcwd(), 'sphinxweb', name)
-    target_dir = os.path.join(app.config['BUILD_DIR'], name)
-    copy_static_entry(source_dir, target_dir, None)

File sphinxweb/

 import sys
 from os import path
-from flask import Flask, g, session, url_for
+from flask import Flask, g, session, url_for, send_from_directory
 from flask.ext.mail import Mail, Message
 from sphinx.websupport import WebSupport
 app = Flask(__name__)
-app.root_path = app.config['BUILD_DIR']
+def sphinx_statics(section, name):
+    directory = path.join(app.config['BUILD_DIR'], 'static', '_' + section)
+    return send_from_directory(directory, name)
 mail = Mail(app)