Skip to content
Snippets Groups Projects
Commit d01a2ee5 authored by Vermaat's avatar Vermaat
Browse files

Started porting to WSGI. Created entrypoint, but nothing really works yet.

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/branches/wsgi-branch@123 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
parent 2ae54306
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/python
"""
General WSGI interface.
This handler calls the webservices handler, the HTML publisher or handles
a request itself, depending on keywords in the URI of the request.
Public fields:
- application ; The WSGI application
@requires: os
@requires: bz2
@requires: mod_python.apache
@requires: mod_python.publisher
@requires: Modules.Web
@requires: Modules.Config
@requires: Modules.File
"""
import os
import bz2
import sys
sys.path.append(os.path.dirname(__file__))
import web
from Modules import Web
from Modules import Config
from Modules import File
urls = (
'/', 'Index',
'.*\.(?:py|cs)', 'Download'
)
app = web.application(urls, globals(), autoreload=False)
# Figure out where this program is located and go to the parent directory.
myPath = os.path.dirname(__file__)
os.chdir(myPath + "/..")
W = Web.Web()
# todo: "downloads/" in req.uri
class Index:
def GET(self):
return W.tal("HTML", "templates/index.html", {})
class Download:
def GET(self):
# Process the file with TAL and return the content as a downloadable file.
file = web.ctx.path.split('/')[-1]
#req.content_type = 'application/octet-stream'
# Force downloading.
web.header('Content-Disposition', 'attachment; filename="%s"' % file)
return W.tal("TEXT", "templates/" + file, {'path': web.ctx.homedomain + web.ctx.homepath})
# todo: "Results" in req.uri:
# todo: "Reference" in req.uri:
# todo: publisher -> index.py
application = app.wsgifunc()
/*
Compilation instructions:
wsdl 'http://<tal tal:replace = "path"></tal>/service/?wsdl'
wsdl '<tal tal:replace = "path"></tal>/service/?wsdl'
gmcs /target:library MutalyzerService.cs -r:System.Web.Services
gmcs /r:MutalyzerService.dll client-mono.cs
*/
......
......@@ -3,7 +3,7 @@
import logging; logging.basicConfig()
from SOAPpy import WSDL
url = 'http://<tal tal:replace = "path"></tal>/service/?wsdl'
url = '<tal tal:replace = "path"></tal>/service/?wsdl'
o = WSDL.Proxy(url)
# Get all transcripts that are hit when we look at position 159272155 on
......
......@@ -3,7 +3,7 @@
import logging; logging.basicConfig()
from suds.client import Client
url = 'http://<tal tal:replace = "path"></tal>/service/?wsdl'
url = '<tal tal:replace = "path"></tal>/service/?wsdl'
c = Client(url)
o = c.service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment