From 527bb0459cf488e5021696e326dc10d28ecdd74c Mon Sep 17 00:00:00 2001 From: Sam Ockman Date: Thu, 24 May 2012 02:18:20 -0400 Subject: Trying to get stuff working under new structure --- wqflask/base/templatePage.py | 222 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) create mode 100755 wqflask/base/templatePage.py (limited to 'wqflask/base/templatePage.py') diff --git a/wqflask/base/templatePage.py b/wqflask/base/templatePage.py new file mode 100755 index 00000000..4dece24a --- /dev/null +++ b/wqflask/base/templatePage.py @@ -0,0 +1,222 @@ +# Copyright (C) University of Tennessee Health Science Center, Memphis, TN. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License +# as published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Affero General Public License for more details. +# +# This program is available from Source Forge: at GeneNetwork Project +# (sourceforge.net/projects/genenetwork/). +# +# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010) +# at rwilliams@uthsc.edu and xzhou15@uthsc.edu +# +# +# +# This module is used by GeneNetwork project (www.genenetwork.org) +# +# Created by GeneNetwork Core Team 2010/08/10 +# +# Last updated by GeneNetwork Core Team 2010/10/20 + +#templatePage.py +# +#--Genenetwork generates a lot of pages; this file is the generic version of them, defining routines they all use. +# +#Classes: +#templatePage +# +#Functions (of templatePage): +#__init__(...) -- class constructor, allows a more specific template to be used in addition to templatePage +#__str__(self) -- returns the object's elements as a tuple +#__del__(self) -- closes the current connection to MySQL, if there is one +#write -- explained below +#writefile -- explained below +#openMysql(self) -- opens a MySQL connection and stores the resulting cursor in the object's cursor variable +#updMysql(self) -- same as openMysql +#error -- explained below +#session -- explained below + + +import socket +import time +import shutil +import MySQLdb +import os + +from htmlgen import HTMLgen2 as HT + +import template +import webqtlConfig +import header +import footer +from utility import webqtlUtil + + + +class templatePage: + + contents = ['title','basehref','js1','js2', 'layer', 'header', 'body', 'footer'] + + # you can pass in another template here if you want + def __init__(self, fd=None, template=template.template): + + # initiate dictionary + self.starttime = time.time() + self.dict = {} + self.template = template + + for item in self.contents: + self.dict[item] = "" + + self.dict['basehref'] = "" #webqtlConfig.BASEHREF + self.cursor = None + + self.cookie = [] #XZ: list to hold cookies (myCookie object) being changed + self.content_type = 'text/html' + self.content_disposition = '' + self.redirection = '' + self.debug = '' + self.attachment = '' + + #XZ: Holding data (new data or existing data being changed) that should be saved to session. The data must be picklable!!! + self.session_data_changed = {} + + self.userName = 'Guest' + self.privilege = 'guest' + if fd.input_session_data.has_key('user'): + self.userName = fd.input_session_data['user'] + if fd.input_session_data.has_key('privilege'): + self.privilege = fd.input_session_data['privilege'] + + def __str__(self): + + #XZ: default setting + thisUserName = self.userName + thisPrivilege = self.privilege + #XZ: user may just go through login or logoff page + if self.session_data_changed.has_key('user'): + thisUserName = self.session_data_changed['user'] + if self.session_data_changed.has_key('privilege'): + thisPrivilege = self.session_data_changed['privilege'] + + if thisUserName == 'Guest': + userInfo = 'Welcome! Login' + else: + userInfo = 'Hi, %s! Logout' % thisUserName + + reload(header) + self.dict['header'] = header.header_string % userInfo + + serverInfo = "It took %2.3f second(s) for %s to generate this page" % (time.time()-self.starttime, socket.getfqdn()) + reload(footer) + self.dict['footer'] = footer.footer_string % serverInfo + + slist = [] + for item in self.contents: + slist.append(self.dict[item]) + return self.template % tuple(slist) + + + def __del__(self): + if self.cursor: + self.cursor.close() + + def write(self): + 'return string representation of this object' + + if self.cursor: + self.cursor.close() + + return str(self) + + def writeFile(self, filename): + 'save string representation of this object into a file' + if self.cursor: + self.cursor.close() + + try: + 'it could take a long time to generate the file, save to .tmp first' + fp = open(os.path.join(webqtlConfig.TMPDIR, filename+'.tmp'), 'wb') + fp.write(str(self)) + fp.close() + path_tmp = os.path.join(webqtlConfig.TMPDIR, filename+'.tmp') + path_html = os.path.join(webqtlConfig.TMPDIR, filename) + shutil.move(path_tmp,path_html) + except: + pass + + def openMysql(self): + try: + self.con = MySQLdb.Connect(db=webqtlConfig.DB_NAME,host=webqtlConfig.MYSQL_SERVER, \ + user=webqtlConfig.DB_USER,passwd=webqtlConfig.DB_PASSWD) + self.cursor = self.con.cursor() + return 1 + except: + heading = "Connect MySQL Server" + detail = ["Can't connect to MySQL server on '"+ webqtlConfig.MYSQL_SERVER+"':100061. \ + The server may be down at this time"] + self.error(heading=heading,detail=detail,error="Error 2003") + return 0 + + def updMysql(self): + try: + self.con = MySQLdb.Connect(db=webqtlConfig.DB_UPDNAME,host=webqtlConfig.MYSQL_UPDSERVER, \ + user=webqtlConfig.DB_UPDUSER,passwd=webqtlConfig.DB_UPDPASSWD) + self.cursor = self.con.cursor() + return 1 + except: + heading = "Connect MySQL Server" + detail = ["update: Can't connect to MySQL server on '"+ webqtlConfig.MYSQL_UPDSERVER+"':100061. \ + The server may be down at this time "] + self.error(heading=heading,detail=detail,error="Error 2003") + return 0 + + def error(self,heading="",intro=[],detail=[],title="Error",error="Error"): + 'generating a WebQTL style error page' + Heading = HT.Paragraph(heading) + Heading.__setattr__("class","title") + + Intro = HT.Blockquote() + if intro: + for item in intro: + Intro.append(item) + else: + Intro.append(HT.Strong('Sorry!'),' Error occurred while processing\ + your request.', HT.P(),'The nature of the error generated is as\ + follows:') + + Detail = HT.Blockquote() + Detail.append(HT.Span("%s : " % error,Class="fwb cr")) + if detail: + Detail2 = HT.Blockquote() + for item in detail: + Detail2.append(item) + Detail.append(HT.Italic(Detail2)) + + #Detail.__setattr__("class","subtitle") + TD_LR = HT.TD(height=200,width="100%",bgColor='#eeeeee',valign="top") + TD_LR.append(Heading,Intro,Detail) + self.dict['body'] = str(TD_LR) + self.dict['title'] = title + + def session(self,mytitle="",myHeading=""): + 'generate a auto-refreshing temporary html file(waiting page)' + self.filename = webqtlUtil.generate_session() + self.dict['title'] = mytitle + self.dict['basehref'] = webqtlConfig.REFRESHSTR % (webqtlConfig.CGIDIR, self.filename) + "" #webqtlConfig.BASEHREF + + TD_LR = HT.TD(align="center", valign="middle", height=200,width="100%", bgColor='#eeeeee') + Heading = HT.Paragraph(myHeading, Class="fwb fs16 cr") + # NL, 07/27/2010. variable 'PROGRESSBAR' has been moved from templatePage.py to webqtlUtil.py; + TD_LR.append(Heading, HT.BR(), webqtlUtil.PROGRESSBAR) + self.dict['body'] = TD_LR + self.writeFile(self.filename + '.html') + return self.filename + + -- cgit v1.2.3 From cad0bdf26b325c7d5fa1757e44db8721a9d86cca Mon Sep 17 00:00:00 2001 From: Sam Ockman Date: Mon, 4 Jun 2012 22:45:24 -0400 Subject: Checkpoint along modifying for data trait and analysis --- wqflask/base/templatePage.py | 44 ++++++++-------- wqflask/wqflask/show_trait/DataEditingPage.py | 73 ++++++++++++++++++--------- wqflask/wqflask/show_trait/show_trait_page.py | 4 +- 3 files changed, 74 insertions(+), 47 deletions(-) (limited to 'wqflask/base/templatePage.py') diff --git a/wqflask/base/templatePage.py b/wqflask/base/templatePage.py index 4dece24a..821c6181 100755 --- a/wqflask/base/templatePage.py +++ b/wqflask/base/templatePage.py @@ -70,13 +70,13 @@ class templatePage: self.starttime = time.time() self.dict = {} self.template = template - + for item in self.contents: self.dict[item] = "" - + self.dict['basehref'] = "" #webqtlConfig.BASEHREF self.cursor = None - + self.cookie = [] #XZ: list to hold cookies (myCookie object) being changed self.content_type = 'text/html' self.content_disposition = '' @@ -89,11 +89,13 @@ class templatePage: self.userName = 'Guest' self.privilege = 'guest' - if fd.input_session_data.has_key('user'): - self.userName = fd.input_session_data['user'] - if fd.input_session_data.has_key('privilege'): - self.privilege = fd.input_session_data['privilege'] - + + # Commenting this out for flask - we'll have to reimplement later - Sam + #if fd.input_session_data.has_key('user'): + # self.userName = fd.input_session_data['user'] + #if fd.input_session_data.has_key('privilege'): + # self.privilege = fd.input_session_data['privilege'] + def __str__(self): #XZ: default setting @@ -126,20 +128,20 @@ class templatePage: def __del__(self): if self.cursor: self.cursor.close() - + def write(self): 'return string representation of this object' if self.cursor: self.cursor.close() - return str(self) - + return str(self) + def writeFile(self, filename): 'save string representation of this object into a file' if self.cursor: self.cursor.close() - + try: 'it could take a long time to generate the file, save to .tmp first' fp = open(os.path.join(webqtlConfig.TMPDIR, filename+'.tmp'), 'wb') @@ -147,9 +149,9 @@ class templatePage: fp.close() path_tmp = os.path.join(webqtlConfig.TMPDIR, filename+'.tmp') path_html = os.path.join(webqtlConfig.TMPDIR, filename) - shutil.move(path_tmp,path_html) + shutil.move(path_tmp,path_html) except: - pass + pass def openMysql(self): try: @@ -176,12 +178,12 @@ class templatePage: The server may be down at this time "] self.error(heading=heading,detail=detail,error="Error 2003") return 0 - + def error(self,heading="",intro=[],detail=[],title="Error",error="Error"): 'generating a WebQTL style error page' Heading = HT.Paragraph(heading) Heading.__setattr__("class","title") - + Intro = HT.Blockquote() if intro: for item in intro: @@ -190,7 +192,7 @@ class templatePage: Intro.append(HT.Strong('Sorry!'),' Error occurred while processing\ your request.', HT.P(),'The nature of the error generated is as\ follows:') - + Detail = HT.Blockquote() Detail.append(HT.Span("%s : " % error,Class="fwb cr")) if detail: @@ -198,7 +200,7 @@ class templatePage: for item in detail: Detail2.append(item) Detail.append(HT.Italic(Detail2)) - + #Detail.__setattr__("class","subtitle") TD_LR = HT.TD(height=200,width="100%",bgColor='#eeeeee',valign="top") TD_LR.append(Heading,Intro,Detail) @@ -210,13 +212,11 @@ class templatePage: self.filename = webqtlUtil.generate_session() self.dict['title'] = mytitle self.dict['basehref'] = webqtlConfig.REFRESHSTR % (webqtlConfig.CGIDIR, self.filename) + "" #webqtlConfig.BASEHREF - + TD_LR = HT.TD(align="center", valign="middle", height=200,width="100%", bgColor='#eeeeee') Heading = HT.Paragraph(myHeading, Class="fwb fs16 cr") - # NL, 07/27/2010. variable 'PROGRESSBAR' has been moved from templatePage.py to webqtlUtil.py; + # NL, 07/27/2010. variable 'PROGRESSBAR' has been moved from templatePage.py to webqtlUtil.py; TD_LR.append(Heading, HT.BR(), webqtlUtil.PROGRESSBAR) self.dict['body'] = TD_LR self.writeFile(self.filename + '.html') return self.filename - - diff --git a/wqflask/wqflask/show_trait/DataEditingPage.py b/wqflask/wqflask/show_trait/DataEditingPage.py index c2e1c37f..1186fa03 100755 --- a/wqflask/wqflask/show_trait/DataEditingPage.py +++ b/wqflask/wqflask/show_trait/DataEditingPage.py @@ -52,35 +52,62 @@ class DataEditingPage(templatePage): ## titles, etc. ############################# - titleTop = HT.Div() - - title1 = HT.Paragraph(" Details and Links", style="border-radius: 5px;", Id="title1", Class="sectionheader") - title1Body = HT.Paragraph(Id="sectionbody1") - - if fd.enablevariance and not varianceDataPage: - title2 = HT.Paragraph(" Submit Variance", style="border-radius: 5px;", Id="title2", Class="sectionheader") - else: - title2 = HT.Paragraph(" Basic Statistics", style="border-radius: 5px;", Id="title2", Class="sectionheader") - title2Body = HT.Paragraph(Id="sectionbody2") - - title3 = HT.Paragraph(" Calculate Correlations", style="border-radius: 5px;", Id="title3", Class="sectionheader") - title3Body = HT.Paragraph(Id="sectionbody3") - - title4 = HT.Paragraph(" Mapping Tools", style="border-radius: 5px;", Id="title4", Class="sectionheader") - title4Body = HT.Paragraph(Id="sectionbody4") - - title5 = HT.Paragraph(" Review and Edit Data", style="border-radius: 5px;", Id="title5", Class="sectionheader") - title5Body = HT.Paragraph(Id="sectionbody5") + #titleTop = HT.Div() + # + #title1 = HT.Paragraph(" Details and Links", style="border-radius: 5px;", Id="title1", Class="sectionheader") + #title1Body = HT.Paragraph(Id="sectionbody1") + # + #if fd.enablevariance and not varianceDataPage: + # title2 = HT.Paragraph(" Submit Variance", style="border-radius: 5px;", Id="title2", Class="sectionheader") + #else: + # title2 = HT.Paragraph(" Basic Statistics", style="border-radius: 5px;", Id="title2", Class="sectionheader") + #title2Body = HT.Paragraph(Id="sectionbody2") + # + #title3 = HT.Paragraph(" Calculate Correlations", style="border-radius: 5px;", Id="title3", Class="sectionheader") + #title3Body = HT.Paragraph(Id="sectionbody3") + # + #title4 = HT.Paragraph(" Mapping Tools", style="border-radius: 5px;", Id="title4", Class="sectionheader") + #title4Body = HT.Paragraph(Id="sectionbody4") + # + #title5 = HT.Paragraph(" Review and Edit Data", style="border-radius: 5px;", Id="title5", Class="sectionheader") + #title5Body = HT.Paragraph(Id="sectionbody5") ############################# ## Hidden field ############################# # Some fields, like method, are defaulted to None; otherwise in IE the field can't be changed using jquery - hddn = {'FormID':fmID, 'RISet':fd.RISet, 'submitID':'', 'scale':'physic', 'additiveCheck':'ON', 'showSNP':'ON', 'showGenes':'ON', 'method':None,\ - 'parentsf14regression':'OFF', 'stats_method':'1', 'chromosomes':'-1', 'topten':'', 'viewLegend':'ON', 'intervalAnalystCheck':'ON', 'valsHidden':'OFF',\ - 'database':'', 'criteria':None, 'MDPChoice':None, 'bootCheck':None, 'permCheck':None, 'applyVarianceSE':None, 'strainNames':'_', 'strainVals':'_',\ - 'strainVars':'_', 'otherStrainNames':'_', 'otherStrainVals':'_', 'otherStrainVars':'_', 'extra_attributes':'_', 'other_extra_attributes':'_'} + hddn = { + 'FormID':fmID, + 'RISet':fd.RISet, + 'submitID':'', + 'scale':'physic', + 'additiveCheck':'ON', + 'showSNP':'ON', + 'showGenes':'ON', + 'method':None, + 'parentsf14regression':'OFF', + 'stats_method':'1', + 'chromosomes':'-1', + 'topten':'', + 'viewLegend':'ON', + 'intervalAnalystCheck':'ON', + 'valsHidden':'OFF', + 'database':'', + 'criteria':None, + 'MDPChoice':None, + 'bootCheck':None, + 'permCheck':None, + 'applyVarianceSE':None, + 'strainNames':'_', + 'strainVals':'_', + 'strainVars':'_', + 'otherStrainNames':'_', + 'otherStrainVals':'_', + 'otherStrainVars':'_', + 'extra_attributes':'_', + 'other_extra_attributes':'_' + } if fd.enablevariance: hddn['enablevariance']='ON' diff --git a/wqflask/wqflask/show_trait/show_trait_page.py b/wqflask/wqflask/show_trait/show_trait_page.py index d4019fd5..a63071c3 100644 --- a/wqflask/wqflask/show_trait/show_trait_page.py +++ b/wqflask/wqflask/show_trait/show_trait_page.py @@ -182,6 +182,6 @@ class ShowTraitPage(DataEditingPage): fd.varianceDispName = 'SE' fd.formID = 'varianceChoice' - self.dict['body']= thisTrait + #self.dict['body']= thisTrait DataEditingPage.__init__(self, fd, thisTrait) - self.dict['title'] = '%s: Display Trait' % fd.identification + #self.dict['title'] = '%s: Display Trait' % fd.identification -- cgit v1.2.3 From 8ac39ead1014953c634e85d0ce340497ecfe2934 Mon Sep 17 00:00:00 2001 From: Sam Ockman Date: Tue, 5 Jun 2012 00:24:44 -0400 Subject: Ran reindent.py recursively on wqflask directory --- .gitignore | 2 + wqflask/base/GeneralObject.py | 77 +- wqflask/base/admin.py | 32 +- wqflask/base/cgiData.py | 60 +- wqflask/base/cookieData.py | 27 +- wqflask/base/header.py | 2 +- wqflask/base/indexBody.py | 414 +-- wqflask/base/myCookie.py | 38 +- wqflask/base/sessionData.py | 27 +- wqflask/base/template.py | 74 +- wqflask/base/templatePage.py | 318 +- wqflask/base/webqtlCaseData.py | 43 +- wqflask/base/webqtlDataset.py | 249 +- wqflask/base/webqtlFormData.py | 516 +-- wqflask/base/webqtlTrait.py | 1152 +++--- .../basicStatistics/BasicStatisticsFunctions.py | 280 +- .../basicStatistics/BasicStatisticsPage_alpha.py | 602 ++-- .../basicStatistics/updatedBasicStatisticsPage.py | 284 +- wqflask/dbFunction/webqtlDatabaseFunction.py | 293 +- wqflask/utility/AJAX_table.py | 224 +- wqflask/utility/Plot.py | 2304 ++++++------ wqflask/utility/TDCell.py | 15 +- wqflask/utility/THCell.py | 16 +- wqflask/utility/svg.py | 133 +- wqflask/utility/webqtlUtil.py | 1459 ++++---- wqflask/wqflask/show_trait/DataEditingPage.py | 3810 ++++++++++---------- wqflask/wqflask/show_trait/show_trait_page.py | 290 +- 27 files changed, 6353 insertions(+), 6388 deletions(-) (limited to 'wqflask/base/templatePage.py') diff --git a/.gitignore b/.gitignore index 8bc78454..fc051245 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ # gitignore *.pyc *.orig +*.bak *~ + diff --git a/wqflask/base/GeneralObject.py b/wqflask/base/GeneralObject.py index 311c9e22..53d1357b 100755 --- a/wqflask/base/GeneralObject.py +++ b/wqflask/base/GeneralObject.py @@ -25,47 +25,44 @@ # Last updated by GeneNetwork Core Team 2010/10/20 class GeneralObject: - """ - Base class to define an Object. - a = [Spam(1, 4), Spam(9, 3), Spam(4,6)] - a.sort(lambda x, y: cmp(x.eggs, y.eggs)) - """ + """ + Base class to define an Object. + a = [Spam(1, 4), Spam(9, 3), Spam(4,6)] + a.sort(lambda x, y: cmp(x.eggs, y.eggs)) + """ - def __init__(self, *args, **kw): - self.contents = list(args) - for name, value in kw.items(): - setattr(self, name, value) - - def __setitem__(self, key, value): - setattr(self, key, value) - - def __getitem__(self, key): - return getattr(self, key) - - def __getattr__(self, key): - if key in self.__dict__.keys(): - return self.__dict__[key] - else: - return eval("self.__dict__.%s" % key) - - def __len__(self): - return len(self.__dict__) - 1 - - def __str__(self): - s = '' - for key in self.__dict__.keys(): - if key != 'contents': - s += '%s = %s\n' % (key,self.__dict__[key]) - return s - - def __repr__(self): - s = '' - for key in self.__dict__.keys(): - s += '%s = %s\n' % (key,self.__dict__[key]) - return s - - def __cmp__(self,other): - return len(self.__dict__.keys()).__cmp__(len(other.__dict__.keys())) + def __init__(self, *args, **kw): + self.contents = list(args) + for name, value in kw.items(): + setattr(self, name, value) + def __setitem__(self, key, value): + setattr(self, key, value) + def __getitem__(self, key): + return getattr(self, key) + def __getattr__(self, key): + if key in self.__dict__.keys(): + return self.__dict__[key] + else: + return eval("self.__dict__.%s" % key) + + def __len__(self): + return len(self.__dict__) - 1 + + def __str__(self): + s = '' + for key in self.__dict__.keys(): + if key != 'contents': + s += '%s = %s\n' % (key,self.__dict__[key]) + return s + + def __repr__(self): + s = '' + for key in self.__dict__.keys(): + s += '%s = %s\n' % (key,self.__dict__[key]) + return s + + def __cmp__(self,other): + return len(self.__dict__.keys()).__cmp__(len(other.__dict__.keys())) diff --git a/wqflask/base/admin.py b/wqflask/base/admin.py index a04df2da..1ba75117 100755 --- a/wqflask/base/admin.py +++ b/wqflask/base/admin.py @@ -35,18 +35,18 @@ ADMIN_search_dbs = { - 'rat': {'PERITONEAL FAT': ['FT_2A_0605_Rz'], + 'rat': {'PERITONEAL FAT': ['FT_2A_0605_Rz'], 'KIDNEY': ['KI_2A_0405_Rz'], 'ADRENAL GLAND': ['HXB_Adrenal_1208'], 'HEART': ['HXB_Heart_1208'] }, - 'mouse': {'CEREBELLUM': ['CB_M_0305_R'], + 'mouse': {'CEREBELLUM': ['CB_M_0305_R'], 'STRIATUM': ['SA_M2_0905_R', 'SA_M2_0405_RC', 'UTHSC_1107_RankInv', 'Striatum_Exon_0209'], - 'HIPPOCAMPUS': ['HC_M2_0606_R', 'UMUTAffyExon_0209_RMA'], - 'WHOLE BRAIN': ['BR_M2_1106_R', 'IBR_M_0106_R', 'BRF2_M_0805_R', 'UCLA_BHF2_BRAIN_0605'], - 'LIVER': ['LV_G_0106_B', 'UCLA_BHF2_LIVER_0605'], - 'EYE': ['Eye_M2_0908_R'], - 'HEMATOPOIETIC STEM CELLS': ['HC_U_0304_R'], + 'HIPPOCAMPUS': ['HC_M2_0606_R', 'UMUTAffyExon_0209_RMA'], + 'WHOLE BRAIN': ['BR_M2_1106_R', 'IBR_M_0106_R', 'BRF2_M_0805_R', 'UCLA_BHF2_BRAIN_0605'], + 'LIVER': ['LV_G_0106_B', 'UCLA_BHF2_LIVER_0605'], + 'EYE': ['Eye_M2_0908_R'], + 'HEMATOPOIETIC STEM CELLS': ['HC_U_0304_R'], 'KIDNEY': ['MA_M2_0806_R'], 'MAMMARY TUMORS': ['MA_M_0704_R', 'NCI_Agil_Mam_Tum_RMA_0409'], 'PREFRONTAL CORTEX': ['VCUSal_1206_R'], @@ -65,14 +65,14 @@ ADMIN_search_dbs = { ###LIST of tissue alias -ADMIN_tissue_alias = {'CEREBELLUM': ['Cb'], - 'STRIATUM': ['Str'], - 'HIPPOCAMPUS': ['Hip'], - 'WHOLE BRAIN': ['Brn'], - 'LIVER': ['Liv'], - 'EYE': ['Eye'], - 'PERITONEAL FAT': ['Fat'], - 'HEMATOPOIETIC STEM CELLS': ['Hsc'], +ADMIN_tissue_alias = {'CEREBELLUM': ['Cb'], + 'STRIATUM': ['Str'], + 'HIPPOCAMPUS': ['Hip'], + 'WHOLE BRAIN': ['Brn'], + 'LIVER': ['Liv'], + 'EYE': ['Eye'], + 'PERITONEAL FAT': ['Fat'], + 'HEMATOPOIETIC STEM CELLS': ['Hsc'], 'KIDNEY': ['Kid'], 'ADRENAL GLAND': ['Adr'], 'HEART': ['Hea'], @@ -84,5 +84,3 @@ ADMIN_tissue_alias = {'CEREBELLUM': ['Cb'], 'ADIPOSE': ['Wfat'], 'RETINA': ['Ret'] } - - diff --git a/wqflask/base/cgiData.py b/wqflask/base/cgiData.py index 57416060..155b3ec3 100755 --- a/wqflask/base/cgiData.py +++ b/wqflask/base/cgiData.py @@ -30,41 +30,37 @@ ######################################### class cgiData(dict): - '''convert Field storage object to Dict object - Filed storage object cannot be properly dumped - ''' + '''convert Field storage object to Dict object + Filed storage object cannot be properly dumped + ''' - def __init__(self, field_storage=None): + def __init__(self, field_storage=None): - if not field_storage: - field_storage={} - - for key in field_storage.keys(): - temp = field_storage.getlist(key) - if len(temp) > 1: - temp = map(self.toValue, temp) - elif len(temp) == 1: - temp = self.toValue(temp[0]) - else: - temp = None - self[key]= temp - - def toValue(self, obj): - '''fieldstorge returns different type of objects, \ - need to convert to string or None''' - try: - return obj.value - except: - return "" - - def getvalue(self, k, default= None): - try: - return self[k] - except: - return default - - getfirst = getvalue + if not field_storage: + field_storage={} + for key in field_storage.keys(): + temp = field_storage.getlist(key) + if len(temp) > 1: + temp = map(self.toValue, temp) + elif len(temp) == 1: + temp = self.toValue(temp[0]) + else: + temp = None + self[key]= temp + def toValue(self, obj): + '''fieldstorge returns different type of objects, \ + need to convert to string or None''' + try: + return obj.value + except: + return "" + def getvalue(self, k, default= None): + try: + return self[k] + except: + return default + getfirst = getvalue diff --git a/wqflask/base/cookieData.py b/wqflask/base/cookieData.py index 4b7c9046..eeb7c0cf 100755 --- a/wqflask/base/cookieData.py +++ b/wqflask/base/cookieData.py @@ -30,23 +30,20 @@ ######################################### class cookieData(dict): - 'convert mod python Cookie object to Dict object' + 'convert mod python Cookie object to Dict object' - def __init__(self, cookies=None): + def __init__(self, cookies=None): - if not cookies: - cookies={} - - for key in cookies.keys(): - self[key.lower()]= cookies[key].value - - def getvalue(self, k, default= None): - try: - return self[k.lower()] - except: - return default - - getfirst = getvalue + if not cookies: + cookies={} + for key in cookies.keys(): + self[key.lower()]= cookies[key].value + def getvalue(self, k, default= None): + try: + return self[k.lower()] + except: + return default + getfirst = getvalue diff --git a/wqflask/base/header.py b/wqflask/base/header.py index b6136b51..ec15e174 100755 --- a/wqflask/base/header.py +++ b/wqflask/base/header.py @@ -3,4 +3,4 @@ import webqtlConfig header_string = open(webqtlConfig.HTMLPATH + 'header.html', 'r').read() header_string = header_string.replace("\\'", "'") header_string = header_string.replace('%"','%%"') -header_string = header_string.replace('', '%s') \ No newline at end of file +header_string = header_string.replace('', '%s') diff --git a/wqflask/base/indexBody.py b/wqflask/base/indexBody.py index aa67dffa..a5bc4c17 100755 --- a/wqflask/base/indexBody.py +++ b/wqflask/base/indexBody.py @@ -1,174 +1,174 @@ index_body_string = """
Select and Search -
+ @@ -185,7 +185,7 @@ Quick HELP Examples and User's Guide - You can also use advanced commands. Copy these simple examples + You can also use advanced commands. Copy these simple examplesWebsites Affiliated with GeneNetwork
--
____________________________ - -
Getting Started
-____________________________ +
Websites Affiliated with GeneNetwork
++
____________________________ + +
Getting Started
+____________________________
How to Use GeneNetwork -
--Take a 20-40 minute GeneNetwork Tour that includes screen shots and typical steps in the analysis.
-
-- -For information about resources and methods, select the
+buttons.
++Take a 20-40 minute GeneNetwork Tour that includes screen shots and typical steps in the analysis.
++-For information about resources and methods, select the
+ + - -buttons.
Try the Workstation site to explore data and features that are being implemented.
-Review the Conditions and Contacts pages for information on the status of data sets and advice on their use and citation.
+Review the Conditions and Contacts pages for information on the status of data sets and advice on their use and citation.
+ +
Mirror and Development Sites
+Mirror and Development Sites
-History and Archive +
History and Archive -
--GeneNetwork's Time Machine links to earlier versions that correspond to specific publication dates.
+++GeneNetwork's Time Machine links to earlier versions that correspond to specific publication dates.
-
- |
-
+ |
+
- |
-
+ |
+