6 def getWebPage(url,params):
7 pdata = urllib.urlencode(params)
8 req = urllib2.Request(url,pdata)
9 wpage = urllib2.urlopen(req)
10 restext = wpage.read()
14 def getProjects(mode,folder):
15 varStatus = 'getting projects with newly defined tasks'
16 url = 'http://myerslab.stanford.edu/analys_track/getProjects'
18 params = {'mode':mode}
19 readw = getWebPage(url,params)
21 tempstr = re.sub(pattern="\n",repl="",string=readw)
22 #match_str = re.compile(r"^<\?xml.+$")
23 match_str = re.compile('^<\?xml.+$')
24 if match_str.search(tempstr):
25 # create file in curret folder
26 file_path = os.path.join(folder,'Projects.xml')
27 f = open(file_path, 'w')
30 varStatus = mode+' Projects.xml created.'
32 varStatus = 'Failed retrieving valid Projects.xml file. Server returned:\n'+readw
36 def updTaskStatus(taskid,updMsg):
37 url = 'http://myerslab.stanford.edu/analys_track/updStatus'
40 params = {'taskid':taskid,'msg':updMsg}
41 # print "Msg: "+updMsg
43 params = {'taskid':taskid}
45 readw = getWebPage(url,params)
49 url = 'http://myerslab.stanford.edu/htsw_reports/updLibInfo'
51 readw = getWebPage(url,params)