source: orange-bioinformatics/server_update/common.py @ 1754:56ba93b2b1e1

Revision 1754:56ba93b2b1e1, 806 bytes checked in by markotoplak, 12 months ago (diff)

Update scripts: warn if username and password are not passed.

RevLine 
[1721]1import Orange
2import Orange.utils.serverfiles as serverfiles
3import Orange.utils.environ as environ
4import os, sys
5import optparse
6import gzip, shutil
7
8usage="""usage: %prog [options] [update_script ...]"""
9
10parser = optparse.OptionParser(usage=usage)
11parser.add_option("-u", "--user", help="User name")
12parser.add_option("-p", "--password", help="Password")
13parser.add_option("-l", "--log-dir", dest="log_dir", help="Directory to store the logs", default="./")
14parser.add_option("-m", "--mailto", help="e-mail the results to EMAIL", metavar="EMAIL", default=None)
15
16option, args = parser.parse_args()
17
[1754]18if not option.user or not option.password:
19    print "Pass -u username -p password!"
20    sys.exit(1)
21
[1721]22sf_server = serverfiles.ServerFiles(option.user, option.password)
23sf_local = Orange.utils.serverfiles
Note: See TracBrowser for help on using the repository browser.