Changeset 21956 in vbox for trunk/src/VBox/Frontends/VBoxShell
- Timestamp:
- Aug 4, 2009 1:37:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r21936 r21956 32 32 import time 33 33 34 # Simple implementation of IConsoleCallback, one can use it as skeleton 34 # Simple implementation of IConsoleCallback, one can use it as skeleton 35 35 # for custom implementations 36 36 class GuestMonitor: … … 39 39 40 40 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) 42 42 def onMouseCapabilityChange(self, supportsAbsolute, needsHostCursor): 43 43 print "%s: onMouseCapabilityChange: needsHostCursor=%d" %(self.mach.name, needsHostCursor) … … 102 102 def onMachineDataChange(self,id): 103 103 print "onMachineDataChange: %s" %(id) 104 104 105 105 def onExtraDataCanChange(self, id, key, value): 106 106 print "onExtraDataCanChange: %s %s=>%s" %(id, key, value) … … 110 110 print "onExtraDataChange: %s %s=>%s" %(id, key, value) 111 111 112 def onMediaRegist red(self, id, type, registred):113 print "onMediaRegist red: %s" %(id)114 115 def onMachineRegist red(self, id, registred):116 print "onMachineRegist red: %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) 117 117 118 118 def onSessionStateChange(self, id, state): … … 309 309 # We need to catch all exceptions here, otherwise callback will never be unregistered 310 310 except: 311 pass 311 pass 312 312 console.unregisterCallback(cb) 313 313 … … 350 350 print 'Trying to use local only functionality, ignored' 351 351 return 352 console=session.console 352 console=session.console 353 353 ops={'pause': lambda: console.pause(), 354 354 'resume': lambda: console.resume(), … … 637 637 aliases[args[1]] = args[2] 638 638 return 0 639 639 640 640 for (k,v) in aliases.items(): 641 641 print "'%s' is an alias for '%s'" %(k,v) … … 677 677 print "3D acceleration NOT available" 678 678 679 print "Network interfaces:" 679 print "Network interfaces:" 680 680 for ni in ctx['global'].getArray(host, 'networkInterfaces'): 681 681 print " %s (%s)" %(ni.name, ni.IPAddress) 682 682 683 print "DVD drives:" 683 print "DVD drives:" 684 684 for dd in ctx['global'].getArray(host, 'DVDDrives'): 685 685 print " %s - %s" %(dd.name, dd.description) 686 686 687 print "USB devices:" 687 print "USB devices:" 688 688 for ud in ctx['global'].getArray(host, 'USBDevices'): 689 689 print " %s (vendorId=%d productId=%d serial=%s) %s" %(ud.product, ud.vendorId, ud.productId, ud.serialNumber, getUSBStateString(ud.state)) … … 729 729 return None 730 730 else: 731 raise Exception("Unknown adapter type: "+type) 732 731 raise Exception("Unknown adapter type: "+type) 732 733 733 734 734 def portForwardCmd(ctx, args): … … 752 752 config = "VBoxInternal/Devices/" + adapterType + "/" 753 753 config = config + str(adapter.slot) +"/LUN#0/Config/" + profile_name 754 754 755 755 mach.setExtraData(config + "/Protocol", proto) 756 756 mach.setExtraData(config + "/HostPort", str(hostPort)) … … 759 759 mach.saveSettings() 760 760 session.close() 761 761 762 762 return 0 763 763 … … 996 996 # This file also will be read automatically on startup or 'reloadExt'. 997 997 # 998 # Also one can put shell extensions into ~/.VirtualBox/shexts and 998 # Also one can put shell extensions into ~/.VirtualBox/shexts and 999 999 # they will also be picked up, so this way one can exchange 1000 1000 # shell extensions easily. … … 1025 1025 addExtsFromFile(ctx, cmds, os.path.join(shextdir,e)) 1026 1026 1027 def interpret(ctx): 1027 def interpret(ctx): 1028 1028 if ctx['remote']: 1029 1029 commands['connect'] = ["Connect to remote VBox instance", connectCmd, 0] 1030 1030 commands['disconnect'] = ["Disconnect from remote VBox instance", disconnectCmd, 0] 1031 1031 1032 1032 vbox = ctx['vb'] 1033 1033 … … 1102 1102 ctx = {'global':g_virtualBoxManager, 1103 1103 'mgr':g_virtualBoxManager.mgr, 1104 'vb':g_virtualBoxManager.vbox, 1104 'vb':g_virtualBoxManager.vbox, 1105 1105 'ifaces':g_virtualBoxManager.constants, 1106 'remote':g_virtualBoxManager.remote, 1106 'remote':g_virtualBoxManager.remote, 1107 1107 'type':g_virtualBoxManager.type, 1108 1108 'run': lambda cmd,args: runCommandCb(ctx, cmd, args), 1109 'machById': lambda id: machById(ctx,id), 1109 'machById': lambda id: machById(ctx,id), 1110 1110 'progressBar': lambda p: progressBar(ctx,p), 1111 1111 '_machlist':None
Note:
See TracChangeset
for help on using the changeset viewer.