-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
160 lines (142 loc) · 6.64 KB
/
Copy pathmain.py
File metadata and controls
160 lines (142 loc) · 6.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# -*- coding: utf-8 -*-
'''
@author: 黄鑫晨
'''
#!/usr/bin/env python
import os
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from sqlalchemy.orm import scoped_session, sessionmaker
from tornado.options import define, options
from Activity.WAcPassVerify import WAcPassVerify
from Activity.WAcUserCreateHandler import AcUserCreateHandler
from Activity.WAcVerify import WAcVerify
from Apcompanions.ApCompanionHandler import ApCompanionHandler
from Appointment.WAPAuthdelete import WAPAuthdelete
from Activity.AcAuthHandler import AcAuthHandler
from Appointment.Newchoosed import NewChoosedHandler
from Appointment.WAPRemind import WAPRemind
from Appointment.WAPdelete import WAPdelete
from Appointment.WAPgetchangeinfo import WAPgetchangeinfo
from Appointment.WAPselect import WAPselect
from Appointment.WAPcomment import APcommentHandler
from Appointment.WAPlistmodel import WAPListmodel
from Appointment.WAPtel import WAPtel
from Appointment.WAPupdateHandler import WAPUpdateHandler
from Database.models import engine
from Activity.AcCreateHandler import AcCreateHandler
from Activity.WAcListAsk import AskActivity
from Activity.WAcregist import WAcregist
from Activity.WAcquitregist import WAquitcregist
from Activity.AcInfo import AcInfoHandler
from Dynamic.WDcreatehandler import WDcreatehandler
from Dynamic.WDdetail import WDdetail
from Dynamic.WDdynamiclist import WDdynamiclist
from FileHandler.GetToken import WgetToken
from FileHandler.Getpicture import Getpicture
from Userinfo.Uaddimages import Uaddimages
from Userinfo.Udeleteimages import Udeleteimages
from Userinfo.Ugetheadimage import Ugetheadimage
from Userinfo.Ugetiamge import Ugetimage
from Userinfo.WUforgotpasswd import WUforgotpasswd
from Userinfo.WUhimgup import WUhimgup
from Userinfo.WUinfoHandler import UinfoHandler
from Userinfo.WUinfoHandler import UinfoHandler
from Userinfo.UserAclist import UserAclist
from Userinfo.UserAplist import UserAplist
from Userinfo.WUserhomepager import UHandler
from Userinfo.WUserjudge import WUserjudge
from Wechatserver.Wver import Wver
from Activity.WAcListAsk import AskActivity
from Activity.WAcregist import WAcregist
from Activity.WAcquitregist import WAquitcregist
from Activity.AcInfo import AcInfoHandler
from Wechatserver.WBasic import WBasic
from Wechatserver.WgetSign import WgetSign
from Appointment.WAPCreatHandler import WAPCreatHandler
from Appointment.WAPListphoto import WAPListphoto
from Activity.WAcseeregist import WAcseeregist
from Appointment.WAPdetail import WAPdetail
from Appointment.WAPregist import WAPregist
from Appointment.WAPregistcancel import WAPregistcancel
from Appointment.WAPselectlist import WAPselectlist
from Appointment.WAPfinish import WAPfinish
#define("port", default=80, help="run on the given port", type=int)
from RegistandLogin.WRegisterHandler import WRegisterHandler
from RegistandLogin.WloginHandler import WLoginHandler
define("port", default=80, help="run on the given port", type=int)
class IndexHandler(tornado.web.RequestHandler):
def get(self):
self.render(r"index.html")
class Application(tornado.web.Application):
def __init__(self):
handlers = [
#(r"/bai")
(r"/", IndexHandler),
#(r"/",WBasic),
(r"/weixin/user/changeinfo", UinfoHandler),
(r"/weixin/user/newchoosed", NewChoosedHandler),
(r"/weixin/activity/getauth", AcAuthHandler),
(r"/weixin/activity/create", AcCreateHandler),
(r"/weixin/activity/aclist", AskActivity),
(r"/weixin/activity/regist", WAcregist),
(r"/weixin/activity/quitregist", WAquitcregist),
(r"/weixin/activity/detail", AcInfoHandler),
(r"/weixin/activity/create", AcCreateHandler),
(r"/weixin/getsign", WgetSign),
(r"/weixin/appointment/ask", WAPCreatHandler),
(r"/weixin/appointment/listphoto", WAPListphoto),
(r"/weixin/appointment/listmodel", WAPListmodel),
(r"/weixin/regist", WRegisterHandler),
(r"/weixin/login", WLoginHandler),
(r"/weixin/activity/registerlist", WAcseeregist),
(r"/weixin/userpage/selfinfo", UHandler),
(r"/weixin/appointment/info", WAPdetail),
(r"/weixin/appointment/regist", WAPregist),
(r"/weixin/appointment/registcancel", WAPregistcancel),
(r"/weixin/appointment/selectlist", WAPselectlist),
(r"/weixin/appointment/update", WAPUpdateHandler),
(r"/weixin/appointment/getupdateinfo",WAPgetchangeinfo),
(r"/weixin/appointment/authdelete", WAPAuthdelete),
(r"/weixin/appointment/delete", WAPdelete),
(r"/weixin/appointment/UserAclist", UserAclist),
(r"/weixin/appointment/UserAplist", UserAplist),
(r"/weixin/appointment/Uchangeimages", Uaddimages),
(r"/weixin/appointment/Ugetimages", Ugetimage),
(r"/weixin/appointment/getToken", WgetToken),
(r"/weixin/appointment/select", WAPselect),
(r"/weixin/appointment/comment",APcommentHandler),
(r"/weixin/appointment/finish", WAPfinish),
(r"/weixin/forgotpasswd", WUforgotpasswd),
(r"/weixin/appointment/tel", WAPtel),
(r"/weixin/user/judge", WUserjudge),
(r"/weixin/getpicurl", Getpicture),
(r"/weixin/appointment/remind",WAPRemind),
(r"/weixin/user/headimage",WUhimgup),
(r"/weixin/dynamic/create",WDcreatehandler),
(r"/weixin/dynamic/list",WDdynamiclist),
(r"/weixin/dynamic/detail",WDdetail),
(r"/weixin/user/getheadimage",Ugetheadimage),
(r"/weixin/activity/userpublishactivity",AcUserCreateHandler),
(r"/weixin/activity/Acverify",WAcVerify),
(r"/weixin/activity/PassAcverify", WAcPassVerify),
(r"/weixin/appointment/companion", ApCompanionHandler),
]
settings = {
"static_path": os.path.join(os.path.dirname(__file__), "static"),
"template_path" : os.path.join(os.path.dirname(__file__), "static"),
} # 配置静态文件路径
tornado.web.Application.__init__(self, handlers, **settings)
self.db = scoped_session(sessionmaker(bind=engine,
autocommit=False, autoflush=True,
expire_on_commit=False))
if __name__ == "__main__":
print "HI,I am in main "
tornado.options.parse_command_line()
Application().listen(options.port)
try:
tornado.ioloop.IOLoop.instance().start()
except KeyboardInterrupt:
tornado.ioloop.IOLoop.instance().stop()