aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorSam Ockman2012-06-04 22:45:24 -0400
committerSam Ockman2012-06-04 22:45:24 -0400
commitcad0bdf26b325c7d5fa1757e44db8721a9d86cca (patch)
tree5870d8d2f9090b6023b644db17c674c7f5167458 /wqflask
parentb2240d137c4d81110994bc8e2e9004bd7a01fe5b (diff)
downloadgenenetwork2-cad0bdf26b325c7d5fa1757e44db8721a9d86cca.tar.gz
Checkpoint along modifying for data trait and analysis
Diffstat (limited to 'wqflask')
-rwxr-xr-xwqflask/base/templatePage.py44
-rwxr-xr-xwqflask/wqflask/show_trait/DataEditingPage.py73
-rw-r--r--wqflask/wqflask/show_trait/show_trait_page.py4
3 files changed, 74 insertions, 47 deletions
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