Changeset 14046


Ignore:
Timestamp:
2009-01-15T23:05:10+01:00 (9 years ago)
Author:
matein4
Message:

Fix parsing of password option; set timeout for writing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/flashing/jungo-image.py

    r13675 r14046  
    151151try: 
    152152    opts, args = getopt.getopt(sys.argv[1:], "hdf:u:qp:P:s:vVw", \ 
    153         ["help", "dump", "file=", "user=", "pass=", "proto=", "proto=", 
     153        ["help", "dump", "file=", "user=", "pass=", "port=", "proto=", 
    154154         "quiet=", "server=", "verbose", "version", "write"]) 
    155155except getopt.GetoptError: 
     
    162162        usage() 
    163163        sys.exit(1) 
    164     if o in ("-V", "--version"): 
    165         print "%s: 0.7" % sys.argv[0] 
     164    elif o in ("-V", "--version"): 
     165        print "%s: 0.8" % sys.argv[0] 
    166166        sys.exit(1) 
    167     if o in ("-d", "--no-dump"): 
     167    elif o in ("-d", "--no-dump"): 
    168168        no_dump = 1 
    169     if o in ("-f", "--file"): 
     169    elif o in ("-f", "--file"): 
    170170        dumpfile = a 
    171     if o in ("-s", "--server"): 
     171    elif o in ("-s", "--server"): 
    172172        server = a 
    173     if o in ("-u", "--user"): 
     173    elif o in ("-u", "--user"): 
    174174        user = a 
    175     if o in ("-p", "--pass"): 
     175    elif o in ("-p", "--pass"): 
    176176        password = a 
    177     if o in ("-P", "--proto"): 
     177    elif o in ("-P", "--proto"): 
    178178        proto = a 
    179     if o in ("--port"): 
    180         PORT = a 
    181     if o in ("-w", "--write"): 
     179    elif o == "--port": 
     180        PORT = int(a) 
     181    elif o in ("-w", "--write"): 
    182182        write_image = 1 
    183     if o in ("-q", "--quiet"): 
     183    elif o in ("-q", "--quiet"): 
    184184        verbose = 0 
    185     if o in ("-v", "--verbose"): 
     185    elif o in ("-v", "--verbose"): 
    186186        verbose = 1 
    187187 
     
    253253    print cmd, 
    254254    tn.write(cmd) 
    255     buf = tn.read_until("Returned 0") 
     255    buf = tn.read_until("Returned 0",10) 
    256256 
    257257tn.write("exit\n") 
Note: See TracChangeset for help on using the changeset viewer.