# Path: mod/_config.py

# 
# Path: mod/models/jwc_cache.py
# class JWCCache(Base):
#     __tablename__ = 'jwc'
#     date = Column(Integer, primary_key=True)
#     text = Column(String(10240), nullable=False)


from .._config import jwcCacheTime
from BeautifulSoup import BeautifulSoup
from config import JWC_URL, TIME_OUT
from tornado.httpclient import HTTPRequest, HTTPClient
from ..models.jwc_cache import JWCCache
from sqlalchemy.orm.exc import NoResultFound
from time import time, localtime, strftime
import tornado.web
import tornado.gen
import json, base64
import urllib,traceback,os
            self.db.commit()
        ret = self.parser()
        lock.text == '0'
        self.db.commit()
        return ret

    def today(self):
        return int(strftime('%Y%m%d', localtime(time())))

    def parser(self):
        retjson = {'code':200,'content':''}
        header = { 
            'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',
            'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
            'Accept-Encoding': 'gzip, deflate, sdch',
            'Accept-Language': 'zh-CN,zh;q=0.8',
            'Host':'jwc.seu.edu.cn',
            'Connection':'keep-alive',
            'Upgrade-Insecure-Requests':'1'
        }
        try:
            client = HTTPClient()
            request = HTTPRequest(JWC_URL, method='GET',headers=header,request_timeout=TIME_OUT)
            response = client.fetch(request)
            html = response.body
            soup = BeautifulSoup(html)
            items = soup.findAll('table', {'width':"100%"})
            info = {
                '最新动态': self.abstract(items[12:17],1), 
                '教务信息': self.abstract(items[34:34+7],0), 

# Path: mod/_config.py

# 
# Path: mod/models/jwc_cache.py
# class JWCCache(Base):
#     __tablename__ = 'jwc'
#     date = Column(Integer, primary_key=True)
#     text = Column(String(10240), nullable=False)


# Path: mod/jwc/handler.py
from .._config import jwcCacheTime
from BeautifulSoup import BeautifulSoup
from config import JWC_URL, TIME_OUT
from tornado.httpclient import HTTPRequest, HTTPClient
from ..models.jwc_cache import JWCCache
from sqlalchemy.orm.exc import NoResultFound
from time import time, localtime, strftime
import tornado.web
import tornado.gen
import json, base64
import urllib,traceback,os

            self.db.commit()
        ret = self.parser()
        lock.text == '0'
        self.db.commit()
        return ret

    def today(self):
        return int(strftime('%Y%m%d', localtime(time())))

    def parser(self):
        retjson = {'code':200,'content':''}
        header = { 
            'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36',
            'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
            'Accept-Encoding': 'gzip, deflate, sdch',
            'Accept-Language': 'zh-CN,zh;q=0.8',
            'Host':'jwc.seu.edu.cn',
            'Connection':'keep-alive',
            'Upgrade-Insecure-Requests':'1'
        }
        try:
            client = HTTPClient()
            request = HTTPRequest(JWC_URL, method='GET',headers=header,request_timeout=TIME_OUT)
            response = client.fetch(request)
            html = response.body
            soup = BeautifulSoup(html)
            items = soup.findAll('table', {'width':"100%"})
            info = {
                '最新动态': self.abstract(items[12:17],1), 
                '教务信息': self.abstract(items[34:34+7],0), 

                '学籍管理': self.abstract(items[45:45+7],0), 