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

    r1720 r1721  
    11##!interval=7 
    22##!contact=ales.erjavec@fri.uni-lj.si 
     3 
     4from common import * 
    35 
    46from Orange.bio import obiTaxonomy 
     
    68import Orange.utils.environ 
    79 
    8 import os, sys, tarfile 
     10import tarfile 
    911import socket 
    1012 
    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(Orange.utils.environ.buffer_dir, "tmp_Taxonomy") 
    19 serverFiles = orngServerFiles.ServerFiles(username, password) 
     13path = os.path.join(environ.buffer_dir, "tmp_Taxonomy") 
    2014u = obiTaxonomy.Update(local_database_path=path) 
    2115 
     
    3024            print ex 
    3125            pass 
    32     serverFiles.upload("Taxonomy", "ncbi_taxonomy.tar.gz", os.path.join(path, "ncbi_taxonomy.tar.gz"), title ="NCBI Taxonomy", 
     26    sf_server.upload("Taxonomy", "ncbi_taxonomy.tar.gz", os.path.join(path, "ncbi_taxonomy.tar.gz"), title ="NCBI Taxonomy", 
    3327                       tags=["NCBI", "taxonomy", "organism names", "essential", "#uncompressed:%i" % uncompressedSize(os.path.join(path, "ncbi_taxonomy.tar.gz"))]) 
    34     serverFiles.unprotect("Taxonomy", "ncbi_taxonomy.tar.gz") 
     28    sf_server.unprotect("Taxonomy", "ncbi_taxonomy.tar.gz") 
Note: See TracChangeset for help on using the changeset viewer.