Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Adapt to new Flask extension module schema #149

Merged
merged 1 commit into from

2 participants

@kini
Owner

Naming your Flask extension module "flaskext.foo" is now discouraged in
favor of naming it "flask_foo". To accommodate both styles, Flask 0.8
and higher allows you to import "flask.ext.foo", which will first try
"flask_foo" and then try "flaskext.foo". We should do this for all our
flask extension imports.

In the short term, this allows sagenb to build against the latest
version of Flask-AutoIndex, i.e. it deals with the following commit:
sublee/flask-autoindex@2138855

@kini kini Adapt to new Flask extension module schema
Naming your Flask extension module "flaskext.foo" is now discouraged in
favor of naming it "flask_foo". To accommodate both styles, Flask 0.8
and higher allows you to import "flask.ext.foo", which will first try
"flask_foo" and then try "flaskext.foo". We should do this for all our
flask extension imports.

In the short term, this allows sagenb to build against the latest
version of Flask-AutoIndex, i.e. it deals with the following commit:
sublee/flask-autoindex@2138855
5511a2a
@kini
Owner

Thanks!

@kini kini merged commit a2046d3 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 2, 2013
  1. @kini

    Adapt to new Flask extension module schema

    kini authored
    Naming your Flask extension module "flaskext.foo" is now discouraged in
    favor of naming it "flask_foo". To accommodate both styles, Flask 0.8
    and higher allows you to import "flask.ext.foo", which will first try
    "flask_foo" and then try "flaskext.foo". We should do this for all our
    flask extension imports.
    
    In the short term, this allows sagenb to build against the latest
    version of Flask-AutoIndex, i.e. it deals with the following commit:
    sublee/flask-autoindex@2138855
This page is out of date. Refresh to see the latest.
View
4 flask_version/admin.py
@@ -1,7 +1,7 @@
import os
from flask import Module, url_for, render_template, request, session, redirect, g, current_app
from decorators import login_required, admin_required, with_lock
-from flaskext.babel import Babel, gettext, ngettext, lazy_gettext
+from flask.ext.babel import Babel, gettext, ngettext, lazy_gettext
_ = gettext
admin = Module('flask_version.admin')
@@ -107,7 +107,7 @@ def notebook_settings():
#Make changes to the default language used
if 'default_language' in request.values:
- from flaskext.babel import refresh
+ from flask.ext.babel import refresh
refresh()
current_app.config['BABEL_DEFAULT_LOCALE'] = request.values['default_language']
View
2  flask_version/authentication.py
@@ -2,7 +2,7 @@
import random
from flask import Module, url_for, render_template, request, session, redirect, g, current_app
from decorators import with_lock
-from flaskext.babel import gettext, ngettext, lazy_gettext
+from flask.ext.babel import gettext, ngettext, lazy_gettext
_ = gettext
authentication = Module('flask_version.authentication')
View
4 flask_version/base.py
@@ -5,10 +5,10 @@
from decorators import login_required, guest_or_login_required, with_lock
from decorators import global_lock
-from flaskext.autoindex import AutoIndex
+from flask.ext.autoindex import AutoIndex
SRC = os.path.join(os.environ['SAGE_ROOT'], 'devel', 'sage', 'sage')
from flask.ext.openid import OpenID
-from flaskext.babel import Babel, gettext, ngettext, lazy_gettext, get_locale
+from flask.ext.babel import Babel, gettext, ngettext, lazy_gettext, get_locale
from sagenb.misc.misc import SAGENB_ROOT, DATA, SAGE_DOC, translations_path
oid = OpenID()
View
2  flask_version/decorators.py
@@ -1,6 +1,6 @@
from functools import wraps
from flask import Flask, url_for, render_template, request, session, redirect, g, current_app
-from flaskext.babel import Babel, gettext, ngettext, lazy_gettext
+from flask.ext.babel import Babel, gettext, ngettext, lazy_gettext
_ = gettext
from threading import Lock
View
2  flask_version/worksheet.py
@@ -3,7 +3,7 @@
from flask import Module, url_for, render_template, request, session, redirect, g, current_app
from decorators import login_required, with_lock
from collections import defaultdict
-from flaskext.babel import Babel, gettext, ngettext, lazy_gettext
+from flask.ext.babel import Babel, gettext, ngettext, lazy_gettext
_ = gettext
from sagenb.notebook.interact import INTERACT_UPDATE_PREFIX
View
2  flask_version/worksheet_listing.py
@@ -4,7 +4,7 @@
import urllib, urlparse
from flask import Module, url_for, render_template, request, session, redirect, g, current_app
from decorators import login_required, guest_or_login_required, with_lock
-from flaskext.babel import Babel, gettext, ngettext, lazy_gettext
+from flask.ext.babel import Babel, gettext, ngettext, lazy_gettext
_ = gettext
worksheet_listing = Module('flask_version.worksheet_listing')
View
2  sagenb/notebook/challenge.py
@@ -27,7 +27,7 @@
import os, random, re, urllib2, urllib
from sagenb.notebook.template import template
-from flaskext.babel import gettext, lazy_gettext
+from flask.ext.babel import gettext, lazy_gettext
_ = lazy_gettext
class ChallengeResponse(object):
View
2  sagenb/notebook/conf.py
@@ -9,7 +9,7 @@
# The full text of the GPL is available at:
# http://www.gnu.org/licenses/
#############################################################################
-from flaskext.babel import gettext, lazy_gettext
+from flask.ext.babel import gettext, lazy_gettext
POS = 'pos'
DESC = 'desc'
View
2  sagenb/notebook/notebook.py
@@ -45,7 +45,7 @@
from . import user_conf # user configuration
from . import user # users
from template import template, prettify_time_ago
-from flaskext.babel import gettext, lazy_gettext
+from flask.ext.babel import gettext, lazy_gettext
try:
# sage is installed
View
2  sagenb/notebook/register.py
@@ -12,7 +12,7 @@
"""
Helper functions dealing with the verification of user
"""
-from flaskext.babel import gettext as _
+from flask.ext.babel import gettext as _
def build_msg(key, username, addr, port, secure):
url_prefix = "https" if secure else "http"
View
2  sagenb/notebook/server_conf.py
@@ -8,7 +8,7 @@
from conf import (POS, DESC, GROUP, TYPE, CHOICES, T_BOOL, T_INTEGER,
T_CHOICE, T_REAL, T_COLOR, T_STRING, T_LIST, T_INFO)
from sagenb.misc.misc import get_languages
-from flaskext.babel import gettext, lazy_gettext
+from flask.ext.babel import gettext, lazy_gettext
_ = lazy_gettext
defaults = {'word_wrap_cols':72,
View
2  sagenb/notebook/template.py
@@ -21,7 +21,7 @@
from sagenb.misc.misc import SAGE_VERSION, DATA, unicode_str
from sagenb.notebook.cell import number_of_rows
-from flaskext.babel import gettext, ngettext, lazy_gettext
+from flask.ext.babel import gettext, ngettext, lazy_gettext
if os.environ.has_key('SAGENB_TEMPLATE_PATH'):
if not os.path.isdir(os.environ['SAGENB_TEMPLATE_PATH']):
View
2  sagenb/notebook/tutorial.py
@@ -348,7 +348,7 @@ def f(n):
#####################################
-from flaskext.babel import lazy_gettext as _
+from flask.ext.babel import lazy_gettext as _
notebook_help = [
(_('Find Help and Documentation'),
View
2  sagenb/notebook/user_conf.py
@@ -7,7 +7,7 @@
from conf import (Configuration, POS, DESC, GROUP, TYPE, CHOICES, T_BOOL,
T_INTEGER, T_CHOICE, T_REAL, T_COLOR, T_STRING, T_LIST)
from sagenb.misc.misc import SAGENB_ROOT, get_languages
-from flaskext.babel import lazy_gettext
+from flask.ext.babel import lazy_gettext
defaults = {'max_history_length':1000,
'default_system':'sage',
View
4 sagenb/notebook/worksheet.py
@@ -57,7 +57,7 @@
# Imports specifically relevant to the sage notebook
from cell import Cell, TextCell
from template import template, clean_name, prettify_time_ago
-from flaskext.babel import gettext, lazy_gettext
+from flask.ext.babel import gettext, lazy_gettext
_ = gettext
# Set some constants that will be used for regular expressions below.
@@ -4288,7 +4288,7 @@ def convert_time_to_string(t):
Converts ``t`` (in Unix time) to a locale-specific string
describing the time and date.
"""
- from flaskext.babel import format_datetime
+ from flask.ext.babel import format_datetime
import datetime, time
try:
return format_datetime(datetime.datetime.fromtimestamp(float(t)))
Something went wrong with that request. Please try again.