Skip to content

Commit

Permalink
Remove dependency on speaklater.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfermigier committed May 31, 2016
1 parent da8e845 commit 5f08e26
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
6 changes: 3 additions & 3 deletions abilian/i18n.py
Expand Up @@ -64,7 +64,8 @@
from babel.support import Translations as BaseTranslations
from flask import _request_ctx_stack, current_app, g, render_template, request
from flask_babel import Babel as BabelBase
from flask_babel import force_locale, gettext, lazy_gettext, ngettext
from flask_babel import (LazyString, force_locale, gettext, lazy_gettext,
ngettext)
from future.utils import string_types
from pathlib import Path

Expand Down Expand Up @@ -110,8 +111,7 @@ def country_name(code):

#: lazy version of :func:`country_name`
def lazy_country_name(code):
from speaklater import make_lazy_string
return make_lazy_string(__gettext_territory, code)
return LazyString(__gettext_territory, code)


def default_country():
Expand Down
22 changes: 10 additions & 12 deletions abilian/services/audit/tests.py
Expand Up @@ -10,9 +10,9 @@
import sqlalchemy as sa
from sqlalchemy import (Column, Date, ForeignKey, Integer, Text, Unicode,
UnicodeText)
from sqlalchemy.orm.attributes import NEVER_SET
from sqlalchemy.orm import relationship, backref
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import backref, relationship
from sqlalchemy.orm.attributes import NEVER_SET

from abilian.core.entities import Entity
from abilian.core.extensions import db
Expand Down Expand Up @@ -55,11 +55,10 @@ class AccountRelated(db.Model):
id = Column(Integer, primary_key=True)

account_id = Column(Integer, ForeignKey(DummyAccount.id), nullable=False)
account = relationship(
DummyAccount,
backref=backref('data',
order_by='AccountRelated.id',
cascade='all, delete-orphan'))
account = relationship(DummyAccount,
backref=backref('data',
order_by='AccountRelated.id',
cascade='all, delete-orphan'))

text = Column(UnicodeText, default="")

Expand All @@ -71,11 +70,10 @@ class CommentRelated(db.Model):
id = Column(Integer, primary_key=True)

related_id = Column(Integer, ForeignKey(AccountRelated.id), nullable=False)
related = relationship(
AccountRelated,
backref=backref('comments',
order_by='CommentRelated.id',
cascade='all, delete-orphan'))
related = relationship(AccountRelated,
backref=backref('comments',
order_by='CommentRelated.id',
cascade='all, delete-orphan'))
text = Column(UnicodeText, default="")


Expand Down
3 changes: 0 additions & 3 deletions requirements.txt
Expand Up @@ -17,9 +17,6 @@ Flask-Testing>=0.4.2
Flask-Uploads
Flask-WTF>=0.9.4

# Used to be a dependency of Flask-Babel.
speaklater

# pathlib is included in python 3.4, and very useful
pathlib

Expand Down

0 comments on commit 5f08e26

Please sign in to comment.