Ignore:
Timestamp:
Jun 2, 2014, 10:34:55 AM (11 years ago)
Author:
aslmd
Message:

MCD web interface. forgot to include a file in the previous commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/mcd/proto/cgi-bin/mcdcgi.py

    r1078 r1277  
    1818import numpy as np
    1919from modules import *
    20 from modules import mcd
    2120
    2221import cStringIO
     
    2726def gethtmlcoord(userinput,defmin,defmax):
    2827   import string
     28   # remove leading and trailing space in order to use space as separator
     29   userinput = userinput.strip()
    2930   # accepted separators. the symbol - should always be last.
    30    separators = [":",";",",","/","_"]
     31   separators = [":",";",",","/","_"," "]
    3132   # initial values
    3233   val = -9999. ; vals = None ; vale = None ; foundinterv = False
     
    7172
    7273# create a MCD object
    73 query=mcd.mcd()
     74# -- use in-code import to choose
     75# --  between official and dev versions
     76try:    dev = form.getvalue("dev")
     77except: dev = "off"
     78if dev == "on":
     79  from modules import mcd_dev
     80  query=mcd_dev.mcd()
     81else:
     82  from modules import mcd
     83  query=mcd.mcd()
    7484
    7585# set MCD version changes if needed
     
    110120badinterv = (islatfree == -1) or (islonfree == -1) or (isloctfree == -1) or (isaltfree == -1)
    111121if badinterv:
    112     errormess = errormess+"<li>Bad syntax. Write a value (or) a range val1;val2 (or) 'all'. Separator shall be either ; : , / _ "
     122    errormess = errormess+"<li>Bad syntax. Write a value (or) a range val1 val2 (or) 'all'. Separator shall be either ; : , / _ space"
    113123badls = (query.datekey == 1 and (query.xdate < 0. or query.xdate > 360.))
    114124if badls:
     
    215225 try: reference = query.getnameset()+str(var1)+str(var2)+str(var3)+str(var4)+str(iswind)+str(isfixedlt)+str(iszonmean)+query.colorm+str(query.min2d)+str(query.max2d)+str(query.dpi)+str(islog)
    216226 except: reference = "test"
     227 if dev == "on": reference = 'dev_'+reference
    217228 if yeaheps:  figname = '../img/'+reference+'.eps'
    218229 else:        figname = '../img/'+reference+'.png'
Note: See TracChangeset for help on using the changeset viewer.