Skip to content

Commit

Permalink
This commit moves the image generation dir *outside*
Browse files Browse the repository at this point in the history
the git repository.
  • Loading branch information
pjotrp committed Feb 25, 2016
1 parent 178ef44 commit f8a0a20
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
11 changes: 4 additions & 7 deletions wqflask/base/webqtlConfig.py
Expand Up @@ -63,22 +63,19 @@

TMPDIR = mk_dir(TEMPDIR+'/gn2/')
CACHEDIR = mk_dir(TEMPDIR+'/cache/')
GENERATED_IMAGE_DIR = TMPDIR # note we can not write into the git tree
GENERATED_IMAGE_DIR = mk_dir(TMPDIR+'/generate/') # we can no longer write into the git tree

GENODIR = flat_files('genotype')+'/'
JSON_GENODIR = assert_dir(GENODIR+'json/')

# GENO_ARCHIVE_DIR = GENODIR + 'archive/'
# TEXTDIR = HTMLPATH + 'ProbeSetFreeze_DataMatrix/'
# CMDLINEDIR = HTMLPATH + 'webqtl/cmdLine/'
# ChangableHtmlPath = GNROOT + 'web/'

# SITENAME = 'GN'
# PORTADDR = "http://50.16.251.170"
# BASEHREF = '<base href="http://50.16.251.170/">'

INFOPAGEHREF = '/dbdoc/%s.html'
# GLOSSARYFILE = "/glossary.html"
CGIDIR = '/webqtl/' #XZ: The variable name 'CGIDIR' should be changed to 'PYTHONDIR'
SCRIPTFILE = 'main.py'

# GLOSSARYFILE = "/glossary.html"
# REFRESHSTR = '<meta http-equiv="refresh" content="5;url=%s' + SCRIPTFILE +'?sid=%s">'
# REFRESHDIR = '%s' + SCRIPTFILE +'?sid=%s'
13 changes: 0 additions & 13 deletions wqflask/wqflask/marker_regression/marker_regression_gn1.py
Expand Up @@ -29,8 +29,6 @@
import string
from math import *
import piddle as pid
# import piddlePIL as pil
# from piddle import Font
import sys,os
import cPickle
import httplib, urllib
Expand All @@ -42,18 +40,7 @@
from utility import helper_functions
from utility import Plot
from base import webqtlConfig
#from intervalAnalyst import GeneUtil
#from base.webqtlTrait import webqtlTrait
#from base.templatePage import templatePage
from utility import webqtlUtil
#from utility.THCell import THCell
#from utility.TDCell import TDCell
#from dbFunction import webqtlDatabaseFunction
#from base.GeneralObject import GeneralObject

#import logging
#logging.basicConfig(filename="/tmp/gn_leiyan.log", level=logging.INFO)
#_log = logging.getLogger("gn\web\webqtl\intervalMapping\IntervalMappingPage.py")

#########################################
# Inteval Mapping Plot Page
Expand Down
2 changes: 1 addition & 1 deletion wqflask/wqflask/templates/marker_regression_gn1.html
Expand Up @@ -30,7 +30,7 @@
<div id="chart_container">
<div class="qtlcharts" id="topchart">
{{ gifmap|safe }}
<img src="/static/output/{{ filename }}.jpeg" usemap="#WebQTLImageMap">
<img src="/generated/{{ filename }}.jpeg" usemap="#WebQTLImageMap">
</div>
</div>
</form>
Expand Down
7 changes: 6 additions & 1 deletion wqflask/wqflask/views.py
Expand Up @@ -30,7 +30,7 @@
from wqflask import app

from flask import (render_template, request, make_response, Response,
Flask, g, config, jsonify, redirect, url_for)
Flask, g, config, jsonify, redirect, url_for, send_from_directory)

from wqflask import search_results
from wqflask import gsearch
Expand All @@ -53,6 +53,7 @@
from utility.tools import TEMPDIR

from base import webqtlFormData
from base.webqtlConfig import GENERATED_IMAGE_DIR
from utility.benchmark import Bench

from pprint import pformat as pf
Expand Down Expand Up @@ -173,6 +174,10 @@ def docedit():
doc = docs.Docs(request.args['entry'])
return render_template("docedit.html", **doc.__dict__)

@app.route('/generated/<filename>')
def generated_file(filename):
return send_from_directory(GENERATED_IMAGE_DIR,filename)

@app.route("/help")
def help():
doc = docs.Docs("help")
Expand Down

0 comments on commit f8a0a20

Please sign in to comment.