diff --git a/isso/__init__.py b/isso/__init__.py index db3981b..41d56a7 100644 --- a/isso/__init__.py +++ b/isso/__init__.py @@ -64,7 +64,7 @@ from werkzeug.contrib.fixers import ProxyFix from isso import db, migrate, views, wsgi from isso.core import ThreadedMixin, uWSGIMixin, Config from isso.utils import parse, http, JSONRequest -from isso.views import comment +from isso.views import comments logging.getLogger('werkzeug').setLevel(logging.ERROR) logging.basicConfig( @@ -78,18 +78,18 @@ class Isso(object): salt = b"Eech7co8Ohloopo9Ol6baimi" urls = Map([ - Rule('/new', methods=['POST'], endpoint=views.comment.new), + Rule('/new', methods=['POST'], endpoint=comments.new), - Rule('/id/', methods=['GET', 'PUT', 'DELETE'], endpoint=views.comment.single), - Rule('/id//like', methods=['POST'], endpoint=views.comment.like), - Rule('/id//dislike', methods=['POST'], endpoint=views.comment.dislike), + Rule('/id/', methods=['GET', 'PUT', 'DELETE'], endpoint=comments.single), + Rule('/id//like', methods=['POST'], endpoint=comments.like), + Rule('/id//dislike', methods=['POST'], endpoint=comments.dislike), - Rule('/', methods=['GET'], endpoint=views.comment.fetch), - Rule('/count', methods=['GET'], endpoint=views.comment.count), - Rule('/delete/', endpoint=views.comment.delete), - Rule('/activate/', endpoint=views.comment.activate), + Rule('/', methods=['GET'], endpoint=comments.fetch), + Rule('/count', methods=['GET'], endpoint=comments.count), + Rule('/delete/', endpoint=comments.delete), + Rule('/activate/', endpoint=comments.activate), - Rule('/check-ip', endpoint=views.comment.checkip) + Rule('/check-ip', endpoint=comments.checkip) ]) @classmethod diff --git a/isso/views/comment.py b/isso/views/comments.py similarity index 99% rename from isso/views/comment.py rename to isso/views/comments.py index 1566700..9173e07 100644 --- a/isso/views/comment.py +++ b/isso/views/comments.py @@ -17,6 +17,7 @@ from isso.compat import text_type as str from isso import utils, notify, db from isso.utils import http, parse +from isso.views import requires from isso.crypto import pbkdf2 logger = logging.getLogger("isso") diff --git a/specs/test_comment.py b/specs/test_comments.py similarity index 99% rename from specs/test_comment.py rename to specs/test_comments.py index 3b4818f..46dd625 100644 --- a/specs/test_comment.py +++ b/specs/test_comments.py @@ -18,7 +18,7 @@ from werkzeug.wrappers import Response from isso import Isso, notify, views, core from isso.utils import http -from isso.views import comment +from isso.views import comments class Dummy: @@ -250,7 +250,7 @@ class TestComments(unittest.TestCase): rv = loads(rv.data) - for key in comment.FIELDS: + for key in comments.FIELDS: rv.pop(key) assert not any(rv.keys())