print "\t--upload-limit <up-speed-limit>"
print "\t-u <up-speed-limit>\tupload speed limitation in KB/s"
print "\t\t\t\t(default is no upload limit)"
+ print "\t--no-hash-check"
+ print "\t-c\t\t\tdisable downloaded file hash checking"
print "\t--version"
print "\t-v\t\t\tprint version and exit"
print "\t--help"
try:
# opts = a list of (option, value) pairs
# args = the list of program arguments left after the option list was stripped
- opts, args = getopt.getopt(sys.argv[1:], "hvu:d:o:p:", ["help", "version", "upload-limit=", "download-limit=", "output-dir=", "port="])
+ opts, args = getopt.getopt(sys.argv[1:], "hvcu:d:o:p:", ["help", "version", "no-hash-check", "upload-limit=", "download-limit=", "output-dir=", "port="])
except getopt.GetoptError, err:
print str(err)
usage()
download_limit = -1
output_dir = os.getcwd()
port = random.randint(10000, 65535)
+ enable_hash_check = True
for o, a in opts:
if o in ("-h", "--help"):
elif o in ("-v", "--version"):
print_version()
sys.exit(0)
+ elif o in ("-c", "--no-hash-check"):
+ enable_hash_check = False
else:
assert False, "unhandled option"
# setup and start download
dscfg = DownloadStartupConfig()
+ dscfg.set_check_hashes(enable_hash_check)
dscfg.set_dest_dir(output_dir);
if download_limit > 0:
dscfg.set_max_speed(DOWNLOAD, download_limit)