Пример #1
0
 def getData(self):
     homeData = None
     try:
         homeData = self.getHomeDataFromCache()
     except CacheInvalidError:
         homeData = self.getHomeData()
     if homeData:
         session = self.getSession(homeData['urlSiteIdMap'])
         homeData['userInfo'] = session.userInfo
         homeData['myFavSites'] = session.myFavSites
         homeData['loggedIn'] = session.loggedIn
     else:
         MBLogger.error('Failed to fetch the home information ... ')
     return (homeData, MBUtils.toJsonStr(homeData) if homeData else None)
Пример #2
0
def handleThreadException(request, exc_info):
    """默认的错误发生时回调函数"""
    traceback.print_exception(*exc_info)
    MBLogger.error("Error occurred while handling the reqeust[" + str(request.taskID) + "]...", exc_info=True)
Пример #3
0
 def handleError(self, message, errno):
     MBLogger.error(message)
     self.handle(errno)
Пример #4
0
 def GET(self):
     print("hello world")
     db = web.database(dbn='mysql', db='test', user='******', passwd='asdfgh')
     print db.select('student', where='id=11')[0]
     MBLogger.info("hello world from aaron")
     return _Template.render("home")
Пример #5
0
 def handleError(self, message, errno):
     MBLogger.error(message)
     self.handle(errno)
Пример #6
0
 def GET(self):
     print("hello world")
     db = web.database(dbn='mysql', db='test', user='******', passwd='asdfgh')
     print db.select('student', where='id=11')[0]
     MBLogger.info("hello world")
     return _Template.render("home")