blob: 2451bd70cc05e86dd0f72d26ee78c70f8b7ecd56 (
plain) (
blame)
| 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
 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import webapp2
from StringIO import StringIO
from ntuceiba import NtuCeibaEvent
from ntuceiba.parse import ntuceiba_parser
from ntuceiba.toxml import ntuceiba_toxml
from google.appengine.api import users
from google.appengine.ext import db
class NtuCeibaImport(webapp2.RedirectHandler):
    def get(self):
        return
    def post(self):
        viewonly = self.request.get('viewonly')
        htmlfile = self.request.get('file')
        if viewonly != "":
            htmlfile = StringIO(htmlfile)
            htmlfile.readline()
            cblist = ntuceiba_parser(htmlfile)
            self.response.headers['Content-Type'] = 'text/xml; charset=UTF-8'
            self.response.out.write(ntuceiba_toxml(cblist))
        
app = webapp2.WSGIApplication([('/access/imnc', NtuCeibaImport)])
 |