Changeset 1721:921b3780c6cc in orange-bioinformatics for server_update/updateDictyBase.py


Ignore:
Timestamp:
09/14/12 12:20:53 (19 months ago)
Author:
markotoplak
Branch:
default
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server_update/updateDictyBase.py

    r1718 r1721  
    11##interval:7 
    2 import Orange.utils.serverfiles 
     2from common import * 
     3 
    34import sys, os 
    45from gzip import GzipFile 
    5 from getopt import getopt 
    66import tempfile 
    77from Orange.bio.obiDicty import DictyBase 
    8 import shutil 
    9  
    10 opt = dict(getopt(sys.argv[1:], "u:p:", ["user=", "password="])[0]) 
    118 
    129tmpdir = tempfile.mkdtemp("dictybase") 
    13  
    14 username = opt.get("-u", opt.get("--user", "username")) 
    15 password = opt.get("-p", opt.get("--password", "password")) 
    16  
    17 print username, password 
    1810 
    1911base = DictyBase.pickle_data() 
     
    2719fn = DictyBase.filename 
    2820 
    29 sf = Orange.utils.serverfiles.ServerFiles(username, password) 
    30  
    3121try: 
    32     sf.create_domain('dictybase') 
     22    sf_server.create_domain('dictybase') 
    3323except: 
    3424    pass 
     
    3626print filename 
    3727 
    38 sf.upload(dom, fn, filename, title="dictyBase gene aliases", 
     28sf_server.upload(dom, fn, filename, title="dictyBase gene aliases", 
    3929    tags=DictyBase.tags) 
    40 sf.unprotect(dom, fn) 
     30sf_server.unprotect(dom, fn) 
    4131 
    4232shutil.rmtree(tmpdir) 
Note: See TracChangeset for help on using the changeset viewer.