Commits

Ronny Pfannschmidt  committed 3e72845

kill the rest of the LodgeIt class

  • Participants
  • Parent commits a8bc82c
  • Branches flask-port

Comments (0)

Files changed (3)

File lodgeit/application.py

 """
 import os
 import flask
-
-class LodgeIt(object):
-    """The WSGI Application"""
-
-    def __init__(self, dburi, secret_key):
-        #: jinja_environment update
-        jinja_environment.globals.update({
-            'i18n_languages': i18n.list_languages()})
-
+from .i18n import list_languages
 
 
 def make_app(dburi, secret_key, debug=False):
     app = flask.Flask('lodgeit', static_path=static_path)
     from flask.ext.babel import Babel
     app.config['SQLALCHEMY_DATABASE_URI'] = dburi
+    app.jinja_env.globals.update({'i18n_languages': list_languages()})
     app.babel = Babel(app)
     app.debug = debug
 
     from lodgeit import controllers
     for blueprint in controllers.all:
         app.register_blueprint(blueprint)
-    
     return app

File lodgeit/i18n/__init__.py

 from babel import Locale, dates, UnknownLocaleError
 from babel.support import Translations
 
-from lodgeit import local
-
 
 _translations = {}
 

File lodgeit/templates/help/advanced.html

     box by clicking on "paste detail". From there you have (depending on
     the type of paste) a couple of options:{% endtrans %}
   </p>
-  <img src="{{ url('static', file='help/advanced_features.png') }}" class="standalone" alt="{% trans %}screenshot of the paste detail box{% endtrans %}">
+  <img src="{{ url_for('static', filename='help/advanced_features.png') }}" class="standalone" alt="{% trans %}screenshot of the paste detail box{% endtrans %}">
   <p>{% trans %}
     In any case you can reply to that paste by clicking on the
     "reply to this paste" link. Also always possible is downloading the
     If you want to see all pastes that are somehow related to the current
     one, click on the "show paste tree" link:{% endtrans %}
   </p>
-  <img src="{{ url('static', file='help/paste_tree.png') }}" class="standalone" alt="{% trans %}screenshot of the paste tree{% endtrans %}">
+  <img src="{{ url_for('static', filename='help/paste_tree.png') }}" class="standalone" alt="{% trans %}screenshot of the paste tree{% endtrans %}">
   <h3>{% trans %}Comparing Pastes{% endtrans %}</h3>
   <p>{% trans %}
     In the diff view you can see the differences between two pastes. Deleted
     lines have a redish background, added lines a bright green one. You can
     also download the changes as unified diff.{% endtrans %}
   </p>
-  <img src="{{ url('static', file='help/diff_view.png') }}" class="standalone" alt="{% trans %}screenshot of the diff viewer{% endtrans %}">
+  <img src="{{ url_for('static', filename='help/diff_view.png') }}" class="standalone" alt="{% trans %}screenshot of the diff viewer{% endtrans %}">
   <h3>{% trans %}Paste Notifications{% endtrans %}</h3>
   <p>{% trans %}
     If someone replies to one of your pastes you will get a notification the