diff options
Diffstat (limited to 'access/imnc.py')
-rw-r--r-- | access/imnc.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/access/imnc.py b/access/imnc.py new file mode 100644 index 0000000..2451bd7 --- /dev/null +++ b/access/imnc.py @@ -0,0 +1,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)]) |