VirtualBox

Changeset 21736 in vbox


Ignore:
Timestamp:
Jul 21, 2009 10:43:15 AM (16 years ago)
Author:
vboxsync
Message:

Python shell: more info in 'host' command

File:
1 edited

Legend:

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

    r21727 r21736  
    624624    return 0
    625625
     626def getUSBStateString(state):
     627    if state == 0:
     628        return "NotSupported"
     629    elif state == 1:
     630        return "Unavailable"
     631    elif state == 2:
     632        return "Busy"
     633    elif state == 3:
     634        return "Available"
     635    elif state == 4:
     636        return "Held"
     637    elif state == 5:
     638        return "Captured"
     639    else:
     640        return "Unknown"
     641
    626642def hostCmd(ctx, args):
    627643   host = ctx['vb'].host
     
    629645   print "Processor count:",cnt
    630646   for i in range(0,cnt):
    631       print "Processor #%d speed: %dMHz" %(i,host.getProcessorSpeed(i))
     647      print "Processor #%d speed: %dMHz %s" %(i,host.getProcessorSpeed(i), host.getProcessorDescription(i))
     648
     649   print "RAM: %dM (free %dM)" %(host.memorySize, host.memoryAvailable)
     650   print "OS: %s (%s)" %(host.operatingSystem, host.OSVersion)
     651   if host.Acceleration3DAvailable:
     652       print "3D acceleration available"
     653   else:
     654       print "3D acceleration NOT available"
     655
     656   print "Network interfaces:"
     657   for ni in ctx['global'].getArray(host, 'networkInterfaces'):
     658       print "  %s (%s)" %(ni.name, ni.IPAddress)
     659
     660   print "DVD drives:"
     661   for dd in ctx['global'].getArray(host, 'DVDDrives'):
     662       print "  %s - %s" %(dd.name, dd.description)
     663
     664   print "USB devices:"
     665   for ud in ctx['global'].getArray(host, 'USBDevices'):
     666       print "  %s (vendorId=%d productId=%d serial=%s) %s" %(ud.product, ud.vendorId, ud.productId, ud.serialNumber, getUSBStateString(ud.state))
    632667
    633668   if ctx['perf']:
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