Changeset 1721:921b3780c6cc in orange-bioinformatics for server_update/updateHomoloGene.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/updateHomoloGene.py

    r1719 r1721  
    22##!contact=ales.erjavec@fri.uni-lj.si 
    33 
     4from common import * 
     5 
    46from Orange.bio import obiHomoloGene 
    5 import Orange.utils.serverfiles as orngServerFiles 
    67 
    7 import Orange.utils.environ as orngEnviron 
    8 import os, sys 
    9 import gzip, shutil 
    10  
    11 from getopt import getopt 
    12  
    13 opt = dict(getopt(sys.argv[1:], "u:p:", ["user=", "password="])[0]) 
    14  
    15 username = opt.get("-u", opt.get("--user", "username")) 
    16 password = opt.get("-p", opt.get("--password", "password")) 
    17  
    18 path = os.path.join(orngEnviron.buffer_dir, "tmp_HomoloGene") 
    19 serverFiles = orngServerFiles.ServerFiles(username, password) 
     8path = os.path.join(environ.buffer_dir, "tmp_HomoloGene") 
    209 
    2110try: 
     
    3120f.close() 
    3221 
    33 #serverFiles.create_domain("HomoloGene") 
     22#sf_server.create_domain("HomoloGene") 
    3423print "Uploading homologene.data" 
    35 serverFiles.upload("HomoloGene", "homologene.data", filename + ".gz", title="HomoloGene", 
     24sf_server.upload("HomoloGene", "homologene.data", filename + ".gz", title="HomoloGene", 
    3625                   tags=["genes", "homologs", "HomoloGene", "#compression:gz", 
    3726                         "#uncompressed:%i" % uncompressed,  
    3827                         "#version:%i" % obiHomoloGene.HomoloGene.VERSION]) 
    39 serverFiles.unprotect("HomoloGene", "homologene.data") 
     28sf_server.unprotect("HomoloGene", "homologene.data") 
    4029 
    4130#### 
     
    117106 
    118107print "Uploading InParanoid.sqlite" 
    119 serverFiles.upload("HomoloGene", "InParanoid.sqlite", filename + ".gz", title="InParanoid: Eukaryotic Ortholog Groups", 
     108sf_server.upload("HomoloGene", "InParanoid.sqlite", filename + ".gz", title="InParanoid: Eukaryotic Ortholog Groups", 
    120109                   tags=["genes", "homologs", "orthologs", "InParanoid", "#compression:gz", 
    121110                         "#uncompressed:%i" % os.stat(filename).st_size, 
    122111                         "#version:%i" % obiHomoloGene.InParanoid.VERSION]) 
    123 serverFiles.unprotect("HomoloGene", "InParanoid.sqlite") 
     112sf_server.unprotect("HomoloGene", "InParanoid.sqlite") 
    124113         
    125114         
Note: See TracChangeset for help on using the changeset viewer.