source: orange-bioinformatics/server_update/updateDictyBase.py @ 1721:921b3780c6cc

Revision 1721:921b3780c6cc, 568 bytes checked in by markotoplak, 19 months ago (diff)

Moved common functionality of the server files update scripts to a separate file.

Line 
1##interval:7
2from common import *
3
4import sys, os
5from gzip import GzipFile
6import tempfile
7from Orange.bio.obiDicty import DictyBase
8
9tmpdir = tempfile.mkdtemp("dictybase")
10
11base = DictyBase.pickle_data()
12filename = os.path.join(tmpdir, "tf")
13
14f = open(filename, 'wb')
15f.write(base)
16f.close()
17
18dom = DictyBase.domain
19fn = DictyBase.filename
20
21try:
22    sf_server.create_domain('dictybase')
23except:
24    pass
25
26print filename
27
28sf_server.upload(dom, fn, filename, title="dictyBase gene aliases",
29    tags=DictyBase.tags)
30sf_server.unprotect(dom, fn)
31
32shutil.rmtree(tmpdir)
Note: See TracBrowser for help on using the repository browser.