Skip to content

Commit

Permalink
Add switch to correct hostnames when local and remote (kind of a hack)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjuggler committed Mar 22, 2013
1 parent 8e95ac6 commit 689927f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions controllers/reconciliotastic.py
Expand Up @@ -44,12 +44,23 @@ def visualize():
# Visualize controller. Does some preprocessing before generating
# the HTML for viewing a given tree.

#Takes in the 'treeName' and 'file' params, and creates the URL
#which can be used to access / download the given tree file.
# Takes in the 'treeName' and 'file' params, and creates the URL
# which can be used to access / download the given tree file. This
# is only really necessary because the <applet> tag requires a
# parameter, which is then sent to Archaeopteryx, that requires
# the *entire* URL of the tree to load. With a non-applet based
# visualization this wouldn't be an issue.
treeFile = current.request.vars.treeName
suffix = current.request.vars.file

# Use the request http_host.
hostname = current.request.env.http_host

# Toggle to phylotastic URL if we detect a NESCENT socket host.
socket_hostname = socket.gethostname()
if 'phylotastic' in socket_hostname.lower():
hostname = 'phylotastic.nescent.org'

treeUrl = URL('static', 'sample_data/demo_'+treeFile+'/input_genetree.nwk'+suffix,
scheme='http', host=hostname)

Expand Down

0 comments on commit 689927f

Please sign in to comment.