Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

Commit

Permalink
Bare edits needed to get it to run under tg v1.1
Browse files Browse the repository at this point in the history
Python2.6
TurboGears1.1
TurboKid
install-pil/Imaging-1.1.7
pip install lxml

all inside a virtualenv
  • Loading branch information
qidane committed Dec 14, 2012
1 parent 7f4f335 commit 0a9acfe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions components/validator/WebApp/setup.py
Expand Up @@ -19,6 +19,8 @@

install_requires = [
"TurboGears >= 1.0.2.2",
"TurboKid",
"SQLObject >= 0.10.1",
],
scripts = ["start-validator.py"],
zip_safe=False,
Expand Down
1 change: 0 additions & 1 deletion components/validator/WebApp/start-validator.py
Expand Up @@ -61,7 +61,6 @@ def Delete_dirs(data):
from validator.controllers import Root
from cherrypy.filters import sessionfilter

cherrypy.root = Root()
cherrypy.config.update({
'server.log_to_screen': True,
'server.environment': 'production',
Expand Down
6 changes: 3 additions & 3 deletions components/validator/WebApp/validator/config/app.cfg
Expand Up @@ -10,14 +10,14 @@

# which view (template engine) to use if one is not specified in the
# template name
# tg.defaultview = "kid"
tg.defaultview = "kid"

# The following kid settings determine the settings used by the kid serializer.

# One of (html|html-strict|xhtml|xhtml-strict|xml|json)
# kid.outputformat="html"
kid.outputformat="html"

# kid.encoding="utf-8"
kid.encoding="utf-8"

# The sitetemplate is used for overall styling of a site that
# includes multiple TurboGears applications
Expand Down
6 changes: 3 additions & 3 deletions components/validator/WebApp/validator/controllers.py
Expand Up @@ -3,7 +3,7 @@
import turbogears, cherrypy, re
from turbogears import controllers, expose, validators
from docutils.core import publish_parts
from time import gmtime, strftime
from time import gmtime, strftime
import os

from OmeValidator import *
Expand Down Expand Up @@ -85,15 +85,15 @@ def upload(self, upload_file, **keywords):
turbogears.flash("File uploaded successfully: %s." % (time+upload_file.filename))
raise turbogears.redirect("/fileslist")

@expose(html="validator.templates.fileslist")
@expose(template="validator.templates.fileslist")
def fileslist(self):
filenames = cherrypy.session.get('filenames', [])
if len(filenames) > 0:
return dict(uploadlist=filenames)
else:
raise turbogears.redirect("/")

@expose(html="validator.templates.result")
@expose(template="validator.templates.result")
def result(self, filename):
# list from session
filenames = cherrypy.session.get('filenames', [])
Expand Down
2 changes: 1 addition & 1 deletion components/validator/WebApp/validator/templates/master.kid
Expand Up @@ -27,7 +27,7 @@
<div id="status_block" class="flash" py:if="value_of('tg_flash', None)" py:content="tg_flash"></div>
<div py:replace="[item.text]+item[:]"/>
</div>
<div id="problem" style=>
<div id="problem">
<h2>Problem with validator</h2>
<p>We are experiencing a problem with the online validator hanging while validating files. This appears to be a problem related to the combination of XML parser and web application toolkit we are using. Unfortunately we cannot get this to work reliably so will have to completely re-write the validator. If you need to validate files we recommend to do so using the Bio-Formats command line <code>bftools</code>.</p>
<p>For further information check the <a href="http://www.openmicroscopy.org/site/support/faq/ome-xml-and-ome-tiff/how-do-i-validate-a-file-on-the-command-line">OME FAQ</a>. </p>
Expand Down

0 comments on commit 0a9acfe

Please sign in to comment.