Skip to content

Commit 8c25384

Browse files
committed
organizing into tree
1 parent fab0d9d commit 8c25384

20 files changed

+83
-58
lines changed

speleo.service/handlers/__init__.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

speleo.service/handlers/root_handler.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

speleo.service/main.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
import tornado.ioloop
66
import tornado.web
77
from tornado.options import define, options
8-
import handlers
9-
import models
10-
import security
11-
from webassets.loaders import PythonLoader
8+
import service
9+
1210

1311
# ------------------------------------------------------------
1412
# options
@@ -48,7 +46,7 @@ def __init__(self):
4846
# ----------------------------------------------------
4947
# handlers
5048
# ----------------------------------------------------
51-
search = inspect.getmembers(handlers)
49+
search = inspect.getmembers(service.handlers)
5250
routes = [(h.RoutePath, h) for n, h in search if 'Handler' in n]
5351

5452
# ----------------------------------------------------
@@ -65,9 +63,9 @@ def __init__(self):
6563
# ----------------------------------------------------
6664
# shared
6765
# ----------------------------------------------------
68-
self.assets = PythonLoader('assets').load_environment()
69-
self.security = security.get_security(options.security, options)
70-
self.database = models.get_database(options.database, options.debug)
66+
self.assets = service.environment#PythonLoader('assets').load_environment()
67+
self.security = service.get_security(options.security, options)
68+
self.database = service.get_database(options.database, options.debug)
7169
#self.cache = memcache.Client([options.cache], debug=options.debug)
7270

7371
# ----------------------------------------------------

speleo.service/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ wsgiref==0.1.2
66
webassets==0.6
77
closure==20110811
88
cssutils==0.9.9
9+
alembic==0.2.1

speleo.service/service/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from service.security import get_security
2+
from service.models import get_database
3+
from service.assets import environment
4+
import service.handlers

speleo.service/assets.py renamed to speleo.service/service/assets.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
environment.register('template', template)
3333
environment.config['jst_compiler'] = '_.template'
3434

35+
36+
# ------------------------------------------------------------
37+
# exports
38+
# ------------------------------------------------------------
39+
__all__ = ['Environment']
40+
3541
if __name__ == "__main__":
3642
print "Compiled stylesheets: ", environment['stylesheet'].urls()
3743
print "Compiled javascripts: ", environment['javascript'].urls()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from service.handlers.root_handler import *
2+
from service.handlers.contact_handler import *
3+
from service.handlers.search_handler import *
4+
from service.handlers.settings_handler import *
5+
from service.handlers.dashboard_handler import *
6+
from service.handlers.blockboard_handler import *
7+
from service.handlers.auth_handler import *
8+
from service.handlers.simple_handler import *
9+
from service.handlers.elastic_handler import *

speleo.service/handlers/auth_handler.py renamed to speleo.service/service/handlers/auth_handler.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import logging
2-
import common
32
import tornado.escape
43
import tornado.auth
54
import tornado.web
5+
from service.handlers.common import BaseHandler
66

77

88
# ------------------------------------------------------------
99
# page handlers
1010
# ------------------------------------------------------------
11-
class LoginHandler(common.BaseHandler):
11+
class LoginHandler(BaseHandler):
1212

1313
RoutePath = r'/auth/login'
1414

@@ -25,7 +25,7 @@ def post(self):
2525
else: self.redirect('/auth/login')
2626

2727

28-
class GoogleAuthHandler(common.BaseHandler, tornado.auth.GoogleMixin):
28+
class GoogleAuthHandler(BaseHandler, tornado.auth.GoogleMixin):
2929

3030
RoutePath = r'/auth/google'
3131

@@ -43,7 +43,7 @@ def _on_auth(self, user):
4343
self.redirect(self.get_argument("next", "/"))
4444

4545

46-
class TwitterAuthHandler(common.BaseHandler, tornado.auth.TwitterMixin):
46+
class TwitterAuthHandler(BaseHandler, tornado.auth.TwitterMixin):
4747

4848
RoutePath = r'/auth/twitter'
4949

@@ -61,7 +61,7 @@ def _on_auth(self, user):
6161
self.redirect(self.get_argument("next", "/"))
6262

6363

64-
class FacebookAuthHandler(common.BaseHandler, tornado.auth.FacebookMixin):
64+
class FacebookAuthHandler(BaseHandler, tornado.auth.FacebookMixin):
6565

6666
RoutePath = r'/auth/facebook'
6767

@@ -79,7 +79,7 @@ def _on_auth(self, user):
7979
self.redirect(self.get_argument("next", "/"))
8080

8181

82-
class LogoutHandler(common.BaseHandler):
82+
class LogoutHandler(BaseHandler):
8383

8484
RoutePath = r'/auth/logout'
8585

speleo.service/handlers/blockboard_handler.py renamed to speleo.service/service/handlers/blockboard_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import common
21
import tornado.web
2+
from service.handlers.common import BaseHandler
33

4-
class BlockboardHandler(common.BaseHandler):
4+
class BlockboardHandler(BaseHandler):
55

66
RoutePath = r'/blockboard'
77

0 commit comments

Comments
 (0)