VirtualBox

Changeset 29800 in vbox for trunk/src


Ignore:
Timestamp:
May 26, 2010 7:25:05 AM (15 years ago)
Author:
vboxsync
Message:

vboxshell: few typos and small bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r29756 r29800  
    843843        print "exec in guest needs at least program name"
    844844        return
    845     user = ""
     845    user = "nike"
    846846    passwd = ""
    847847    tmo = 0
     
    17021702       if dvd.state != ctx['global'].constants.MediumState_Created:
    17031703           dvd.refreshState()
    1704        print "   %s (%s)%s %s" %(colPath(ctx,dvd.location), dvd.format,optId(verbose,hdd.id),colSizeM(ctx,asSize(hdd.size, True)))
     1704       print "   %s (%s)%s %s" %(colPath(ctx,dvd.location), dvd.format,optId(verbose,dvd.id),colSizeM(ctx,asSize(dvd.size, True)))
    17051705
    17061706   floppys = ctx['global'].getArray(ctx['vb'], 'floppyImages')
     
    17091709       if floppy.state != ctx['global'].constants.MediumState_Created:
    17101710           floppy.refreshState()
    1711        print "   %s (%s)%s %s" %(colPath(ctx,floppy.location), floppy.format,optId(verbose,hdd.id), colSizeM(ctx,asSize(hdd.size, True)))
     1711       print "   %s (%s)%s %s" %(colPath(ctx,floppy.location), floppy.format,optId(verbose,floppy.id), colSizeM(ctx,asSize(floppy.size, True)))
    17121712
    17131713   return 0
     
    24072407    }
    24082408
    2409     if args[1] == 'help':
     2409    if len(args) < 2 or args[1] == 'help':
    24102410        if len(args) > 2:
    24112411            print natcommands[args[2]].__doc__
     
    24702470    (rc, r) = nicSwitchOnOff(adapter, 'traceEnabled', args)
    24712471    if len(args) == 1 and rc == 0:
    2472         r = '%s file:%s' % (r, adapter.traceFile) 
     2472        r = '%s file:%s' % (r, adapter.traceFile)
    24732473        return (0, r)
    24742474    elif len(args) == 3 and rc == 0:
     
    25292529            ctx['global'].constants.NetworkAttachmentType_HostOnly: ('HostOnly', adapter.hostInterface),
    25302530            #ctx['global'].constants.NetworkAttachmentType_VDE: ('VDE', adapter.VDENetwork)
    2531         } 
     2531        }
    25322532        import types
    25332533        if type(adapter.attachmentType) != types.IntType:
     
    25402540        nicAttachmentType = {
    25412541            'Null': {
    2542                 'v': lambda: len(args) == 2, 
     2542                'v': lambda: len(args) == 2,
    25432543                'p': lambda: 'do nothing',
    25442544                'f': lambda: adapter.detach()},
    25452545            'NAT': {
    2546                 'v': lambda: len(args) == 2, 
     2546                'v': lambda: len(args) == 2,
    25472547                'p': lambda: 'do nothing',
    25482548                'f': lambda: adapter.attachToNAT()},
     
    25592559                'p': lambda: adapter.__setattr__('hostInterface', args[2]),
    25602560                'f': lambda: adapter.attachToHostOnlyInterface()},
    2561             'VDE': { 
     2561            'VDE': {
    25622562                'v': lambda: len(args) == 3,
    25632563                'p': lambda: adapter.__setattr__('VDENetwork', args[2]),
    25642564                'f': lambda: adapter.attachToVDE()}
    2565         } 
     2565        }
    25662566        if args[1] not in nicAttachmentType.keys():
    25672567            print '{0} not in acceptable values ({1})'.format(args[1], nicAttachmentType.keys())
    25682568            return (1, None)
    25692569        if not nicAttachmentType[args[1]]['v']():
    2570             print nicAttachmentType.__doc__ 
     2570            print nicAttachmentType.__doc__
    25712571            return (1, None)
    25722572        nicAttachmentType[args[1]]['p']()
     
    25762576def nicCmd(ctx, args):
    25772577    '''
    2578     This command to manage network adapters 
     2578    This command to manage network adapters
    25792579    usage: nic <vm> <nicnum> <cmd> <cmd-args>
    25802580    where cmd : attachment, trace, linespeed, cable, enable, type
     
    25892589        'type': nicTypeSubCmd
    25902590    }
    2591     if     args[1] == 'help' \
    2592         or len(args) < 2 \
     2591    if  len(args) < 2 \
     2592        or args[1] == 'help' \
    25932593        or (len(args) > 2 and args[3] not in niccomand):
    25942594        if len(args) == 3 \
    25952595           and args[2] in niccomand:
    2596             print niccomand[args[2]].__doc__ 
     2596            print niccomand[args[2]].__doc__
    25972597        else:
    25982598            print nicCmd.__doc__
     
    26032603        print 'please specify vm'
    26042604        return 0
    2605      
     2605
    26062606    if    len(args) < 3 \
    26072607       or not args[2].isdigit() \
     
    26112611    nicnum = int(args[2])
    26122612    cmdargs = args[3:]
    2613     func = args[3] 
     2613    func = args[3]
    26142614    session = None
    2615     session = ctx['global'].openMachineSession(vm.id) 
     2615    session = ctx['global'].openMachineSession(vm.id)
    26162616    vm = session.machine
    26172617    adapter = vm.getNetworkAdapter(nicnum)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette