VirtualBox

Ignore:
Timestamp:
May 17, 2010 10:24:35 AM (15 years ago)
Author:
vboxsync
Message:

Python shell: spaces

File:
1 edited

Legend:

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

    r29265 r29524  
    3838
    3939    def onMousePointerShapeChange(self, visible, alpha, xHot, yHot, width, height, shape):
    40         print  "%s: onMousePointerShapeChange: visible=%d" %(self.mach.name, visible)
     40        print  "%s: onMousePointerShapeChange: visible=%d shape=%d bytes" %(self.mach.name, visible,len(shape))
     41
    4142    def onMouseCapabilityChange(self, supportsAbsolute, supportsRelative, needsHostCursor):
    4243        print  "%s: onMouseCapabilityChange: supportsAbsolute = %d, supportsRelative = %d, needsHostCursor = %d" %(self.mach.name, supportsAbsolute, supportsRelative, needsHostCursor)
     
    21732174
    21742175def natAlias(ctx, mach, nicnum, nat, args=[]):
    2175     """This command shows/alters NAT's alias settings. 
     2176    """This command shows/alters NAT's alias settings.
    21762177    usage: nat <vm> <nicnum> alias [default|[log] [proxyonly] [sameports]]
    21772178    default - set settings to default values
    21782179    log - switch on alias loging
    21792180    proxyonly - switch proxyonly mode on
    2180     sameports - enforces NAT using the same ports 
     2181    sameports - enforces NAT using the same ports
    21812182    """
    21822183    alias = {
     
    21882189        first = 0
    21892190        msg = ''
    2190         for aliasmode, aliaskey in alias.iteritems(): 
     2191        for aliasmode, aliaskey in alias.iteritems():
    21912192            if first == 0:
    21922193                first = 1
    21932194            else:
    21942195                msg += ', '
    2195             if int(nat.aliasMode) & aliaskey: 
     2196            if int(nat.aliasMode) & aliaskey:
    21962197                msg += '{0}: {1}'.format(aliasmode, 'on')
    21972198            else:
     
    22142215    usage: nat <vm> <nicnum> settings [<mtu> [[<socsndbuf> <sockrcvbuf> [<tcpsndwnd> <tcprcvwnd>]]]]
    22152216    mtu - set mtu <= 16000
    2216     socksndbuf/sockrcvbuf - sets amount of kb for socket sending/receiving buffer 
     2217    socksndbuf/sockrcvbuf - sets amount of kb for socket sending/receiving buffer
    22172218    tcpsndwnd/tcprcvwnd - sets size of initial tcp sending/receiving window
    22182219    """
     
    22332234            if not args[i].isdigit() or int(args[i]) < 8 or int(args[i]) > 1024:
    22342235                print 'invalid {0} parameter ({1} not in range [8-1024])'.format(i, args[i])
    2235                 return (1, None) 
     2236                return (1, None)
    22362237        a = [args[1]]
    22372238        if len(args) < 6:
    2238             for i in range(2, len(args)): a.append(args[i]) 
     2239            for i in range(2, len(args)): a.append(args[i])
    22392240            for i in range(len(args), 6): a.append(0)
    22402241        else:
    2241             for i in range(2, len(args)): a.append(args[i]) 
     2242            for i in range(2, len(args)): a.append(args[i])
    22422243        #print a
    22432244        nat.setNetworkSettings(int(a[0]), int(a[1]), int(a[2]), int(a[3]), int(a[4]))
     
    23042305def natPortForwarding(ctx, mach, nicnum, nat, args):
    23052306    """This command shows/manages port-forwarding settings
    2306     usage: 
     2307    usage:
    23072308        nat <vm> <nicnum> <pf> [ simple tcp|udp <hostport> <guestport>]
    2308             |[no_name tcp|udp <hostip> <hostport> <guestip> <guestport>] 
     2309            |[no_name tcp|udp <hostip> <hostport> <guestip> <guestport>]
    23092310            |[ex tcp|udp <pf-name> <hostip> <hostport> <guestip> <guestport>]
    23102311            |[delete <pf-name>]
     
    23232324        pfcmd = {
    23242325            'simple': {
    2325                 'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 5, 
     2326                'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 5,
    23262327                'func':lambda: nat.addRedirect('', proto[args[2]], '', int(args[3]), '', int(args[4]))
    23272328            },
    2328             'no_name': { 
    2329                 'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 7, 
     2329            'no_name': {
     2330                'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 7,
    23302331                'func': lambda: nat.addRedirect('', proto[args[2]], args[3], int(args[4]), args[5], int(args[6]))
    23312332            },
    2332             'ex': { 
    2333                 'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 8, 
     2333            'ex': {
     2334                'validate': lambda: args[1] in pfcmd.keys() and args[2] in proto.keys() and len(args) == 8,
    23342335                'func': lambda: nat.addRedirect(args[3], proto[args[2]], args[4], int(args[5]), args[6], int(args[7]))
    23352336            },
     
    23382339                'func': lambda: nat.removeRedirect(args[2])
    23392340            }
    2340         } 
     2341        }
    23412342
    23422343        if not pfcmd[args[1]]['validate']():
     
    23492350
    23502351def natNetwork(ctx, mach, nicnum, nat, args):
    2351     """This command shows/alters NAT network settings 
     2352    """This command shows/alters NAT network settings
    23522353    usage: nat <vm> <nicnum> network [<network>]
    23532354    """
     
    24022403    for i in range(3, len(args)):
    24032404        cmdargs.append(args[i])
    2404        
    2405     # @todo vvl if nicnum is missed but command is entered 
     2405
     2406    # @todo vvl if nicnum is missed but command is entered
    24062407    # use NAT func for every adapter on machine.
    24072408    func = args[3]
     
    24152416    adapter = mach.getNetworkAdapter(nicnum)
    24162417    natEngine = adapter.natDriver
    2417     (rc, report) = natcommands[func](ctx, mach, nicnum, natEngine, cmdargs) 
     2418    (rc, report) = natcommands[func](ctx, mach, nicnum, natEngine, cmdargs)
    24182419    if rosession == 0:
    24192420        if rc == 0:
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