Skip to content

Commit

Permalink
Improve imports to avoid circurlar references.
Browse files Browse the repository at this point in the history
Under Python 3 a launch script would get ImportError when importing from
flask_sentinel or flask.ext.sentinel.

See
https://groups.google.com/forum/?hl=en#!topic/python-eve/sk2xsNIpejI.
  • Loading branch information
nicolaiarocci committed Jul 8, 2015
1 parent 4b282ae commit a90b737
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ Flask-Sentinel Changelog

Here you can see the full list of changes between releases.

Version 0.0.4
-------------

Released on 8 July, 2015

- Fix: Circular reference prevents package from running under Python 3.

Version 0.0.3
-------------

Expand Down
2 changes: 1 addition & 1 deletion flask_sentinel/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from flask_sentinel import ResourceOwnerPasswordCredentials, oauth # noqa
from .flask_sentinel import ResourceOwnerPasswordCredentials, oauth # noqa
4 changes: 2 additions & 2 deletions flask_sentinel/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import bcrypt
from werkzeug.security import gen_salt

from core import mongo, redis
from models import Client, User, Token
from .core import mongo, redis
from .models import Client, User, Token


# TODO use SONManipulator instead of custom de/serializers perhaps?
Expand Down
8 changes: 4 additions & 4 deletions flask_sentinel/flask_sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"""
from flask import Blueprint

import views
from core import oauth, mongo, redis
from utils import Config
from validator import MyRequestValidator
from . import views
from .core import oauth, mongo, redis
from .utils import Config
from .validator import MyRequestValidator
from redis.connection import ConnectionPool


Expand Down
2 changes: 1 addition & 1 deletion flask_sentinel/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"""
from flask_oauthlib.provider import OAuth2RequestValidator

from data import Storage
from .data import Storage


class MyRequestValidator(OAuth2RequestValidator):
Expand Down
4 changes: 2 additions & 2 deletions flask_sentinel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"""
from flask import render_template, request

from core import oauth
from data import Storage
from .core import oauth
from .data import Storage


@oauth.token_handler
Expand Down

0 comments on commit a90b737

Please sign in to comment.