# Path: mod/models/data_cache.py
# class DataCache(Base):
#     __tablename__ = 'data'
#     key = Column(Integer, primary_key=True)
#     data = Column(String(10240), nullable=False)


import tornado.web
import json, base64
from ..models.data_cache import DataCache
from sqlalchemy.orm.exc import NoResultFound
            self.db.close()
            self.finish()

    def init_db(self):
        bus_json = {
            "weekend":{
                "前往地铁站":[
                    { "time":"8:00-9:30", "bus":"每 30min 一班"},
                    { "time":"9:30-11:30", "bus":"每 1h 一班"},
                    { "time":"11:30-13:00", "bus":"每 30min 一班"},
                    { "time":"13:30-16:30", "bus":"每 1h 一班"},
                    { "time":"17:00-19:00", "bus":"每 30min 一班"},
                    { "time":"19:00-22:00", "bus":"每 1h 一班"}
                ],
                "返回九龙湖":[
                    { "time":"8:00-9:30", "bus":"每 30min 一班"},
                    { "time":"9:30-11:30", "bus":"每 1h 一班"},
                    { "time":"11:30-13:00", "bus":"每 30min 一班"},
                    { "time":"13:30-16:30", "bus":"每 1h 一班"},
                    { "time":"17:00-19:00", "bus":"每 30min 一班"},
                    { "time":"19:00-22:00", "bus":"每 1h 一班"}
                ]
            },
            "weekday":{
                "前往地铁站":[
                    { "time":"7:10-10:00", "bus":"每 10min 一班"},
                    { "time":"10:00-11:30", "bus":"每 30min 一班"},
                    { "time":"11:30-13:30", "bus":"每 10min 一班"},
                    { "time":"13:30-15:00", "bus":"13:30,14:00"},
                    { "time":"15:00-15:50", "bus":"每 10min 一班"},

# Path: mod/models/data_cache.py
# class DataCache(Base):
#     __tablename__ = 'data'
#     key = Column(Integer, primary_key=True)
#     data = Column(String(10240), nullable=False)


# Path: mod/schoolbus/handler.py
import tornado.web
import json, base64
from ..models.data_cache import DataCache
from sqlalchemy.orm.exc import NoResultFound

            self.db.close()
            self.finish()

    def init_db(self):
        bus_json = {
            "weekend":{
                "前往地铁站":[
                    { "time":"8:00-9:30", "bus":"每 30min 一班"},
                    { "time":"9:30-11:30", "bus":"每 1h 一班"},
                    { "time":"11:30-13:00", "bus":"每 30min 一班"},
                    { "time":"13:30-16:30", "bus":"每 1h 一班"},
                    { "time":"17:00-19:00", "bus":"每 30min 一班"},
                    { "time":"19:00-22:00", "bus":"每 1h 一班"}
                ],
                "返回九龙湖":[
                    { "time":"8:00-9:30", "bus":"每 30min 一班"},
                    { "time":"9:30-11:30", "bus":"每 1h 一班"},
                    { "time":"11:30-13:00", "bus":"每 30min 一班"},
                    { "time":"13:30-16:30", "bus":"每 1h 一班"},
                    { "time":"17:00-19:00", "bus":"每 30min 一班"},
                    { "time":"19:00-22:00", "bus":"每 1h 一班"}
                ]
            },
            "weekday":{
                "前往地铁站":[
                    { "time":"7:10-10:00", "bus":"每 10min 一班"},
                    { "time":"10:00-11:30", "bus":"每 30min 一班"},
                    { "time":"11:30-13:30", "bus":"每 10min 一班"},
                    { "time":"13:30-15:00", "bus":"13:30,14:00"},
                    { "time":"15:00-15:50", "bus":"每 10min 一班"},

                    { "time":"16:00-17:00", "bus":"16:00"},