VirtualBox

Ignore:
Timestamp:
Aug 4, 2009 1:37:40 PM (15 years ago)
Author:
vboxsync
Message:

Python: spaces cleanup, fixed typo in callback names

File:
1 edited

Legend:

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

    r21936 r21956  
    3232import time
    3333
    34 # Simple implementation of IConsoleCallback, one can use it as skeleton 
     34# Simple implementation of IConsoleCallback, one can use it as skeleton
    3535# for custom implementations
    3636class GuestMonitor:
     
    3939
    4040    def onMousePointerShapeChange(self, visible, alpha, xHot, yHot, width, height, shape):
    41         print  "%s: onMousePointerShapeChange: visible=%d" %(self.mach.name, visible) 
     41        print  "%s: onMousePointerShapeChange: visible=%d" %(self.mach.name, visible)
    4242    def onMouseCapabilityChange(self, supportsAbsolute, needsHostCursor):
    4343        print  "%s: onMouseCapabilityChange: needsHostCursor=%d" %(self.mach.name, needsHostCursor)
     
    102102    def onMachineDataChange(self,id):
    103103        print "onMachineDataChange: %s" %(id)
    104    
     104
    105105    def onExtraDataCanChange(self, id, key, value):
    106106        print "onExtraDataCanChange: %s %s=>%s" %(id, key, value)
     
    110110        print "onExtraDataChange: %s %s=>%s" %(id, key, value)
    111111
    112     def onMediaRegistred(self, id, type, registred):
    113         print "onMediaRegistred: %s" %(id)
    114 
    115     def onMachineRegistred(self, id, registred):
    116         print "onMachineRegistred: %s" %(id)
     112    def onMediaRegistered(self, id, type, registered):
     113        print "onMediaRegistered: %s" %(id)
     114
     115    def onMachineRegistered(self, id, registred):
     116        print "onMachineRegistered: %s" %(id)
    117117
    118118    def onSessionStateChange(self, id, state):
     
    309309    # We need to catch all exceptions here, otherwise callback will never be unregistered
    310310    except:
    311         pass   
     311        pass
    312312    console.unregisterCallback(cb)
    313313
     
    350350        print 'Trying to use local only functionality, ignored'
    351351        return
    352     console=session.console   
     352    console=session.console
    353353    ops={'pause':           lambda: console.pause(),
    354354         'resume':          lambda: console.resume(),
     
    637637        aliases[args[1]] = args[2]
    638638        return 0
    639    
     639
    640640    for (k,v) in aliases.items():
    641641        print "'%s' is an alias for '%s'" %(k,v)
     
    677677       print "3D acceleration NOT available"
    678678
    679    print "Network interfaces:" 
     679   print "Network interfaces:"
    680680   for ni in ctx['global'].getArray(host, 'networkInterfaces'):
    681681       print "  %s (%s)" %(ni.name, ni.IPAddress)
    682682
    683    print "DVD drives:" 
     683   print "DVD drives:"
    684684   for dd in ctx['global'].getArray(host, 'DVDDrives'):
    685685       print "  %s - %s" %(dd.name, dd.description)
    686686
    687    print "USB devices:" 
     687   print "USB devices:"
    688688   for ud in ctx['global'].getArray(host, 'USBDevices'):
    689689       print "  %s (vendorId=%d productId=%d serial=%s) %s" %(ud.product, ud.vendorId, ud.productId, ud.serialNumber, getUSBStateString(ud.state))
     
    729729        return None
    730730    else:
    731         raise Exception("Unknown adapter type: "+type)   
    732    
     731        raise Exception("Unknown adapter type: "+type)
     732
    733733
    734734def portForwardCmd(ctx, args):
     
    752752    config = "VBoxInternal/Devices/" + adapterType + "/"
    753753    config = config + str(adapter.slot)  +"/LUN#0/Config/" + profile_name
    754  
     754
    755755    mach.setExtraData(config + "/Protocol", proto)
    756756    mach.setExtraData(config + "/HostPort", str(hostPort))
     
    759759    mach.saveSettings()
    760760    session.close()
    761    
     761
    762762    return 0
    763763
     
    996996# This file also will be read automatically on startup or 'reloadExt'.
    997997#
    998 # Also one can put shell extensions into ~/.VirtualBox/shexts and 
     998# Also one can put shell extensions into ~/.VirtualBox/shexts and
    999999# they will also be picked up, so this way one can exchange
    10001000# shell extensions easily.
     
    10251025        addExtsFromFile(ctx, cmds, os.path.join(shextdir,e))
    10261026
    1027 def interpret(ctx):   
     1027def interpret(ctx):
    10281028    if ctx['remote']:
    10291029        commands['connect'] = ["Connect to remote VBox instance", connectCmd, 0]
    10301030        commands['disconnect'] = ["Disconnect from remote VBox instance", disconnectCmd, 0]
    1031    
     1031
    10321032    vbox = ctx['vb']
    10331033
     
    11021102    ctx = {'global':g_virtualBoxManager,
    11031103           'mgr':g_virtualBoxManager.mgr,
    1104            'vb':g_virtualBoxManager.vbox, 
     1104           'vb':g_virtualBoxManager.vbox,
    11051105           'ifaces':g_virtualBoxManager.constants,
    1106            'remote':g_virtualBoxManager.remote, 
     1106           'remote':g_virtualBoxManager.remote,
    11071107           'type':g_virtualBoxManager.type,
    11081108           'run': lambda cmd,args: runCommandCb(ctx, cmd, args),
    1109            'machById': lambda id: machById(ctx,id), 
     1109           'machById': lambda id: machById(ctx,id),
    11101110           'progressBar': lambda p: progressBar(ctx,p),
    11111111           '_machlist':None
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