VirtualBox

Changeset 27951 in vbox for trunk/src


Ignore:
Timestamp:
Apr 1, 2010 5:53:00 PM (15 years ago)
Author:
vboxsync
Message:

Python shell: misc tweaks, tab-completion on Macs

File:
1 edited

Legend:

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

    r27919 r27951  
    201201  completer = CompleterNG(comps, ctx)
    202202  readline.set_completer(completer.complete)
     203  # OSX need it
     204  readline.parse_and_bind ("bind ^I rl_complete")
    203205  readline.parse_and_bind("tab: complete")
    204206
     
    541543        return "Unknown"
    542544
    543 def getFirmwareType(type):
    544     if type == 0:
    545         return "invalid"
    546     elif type == 1:
    547         return "bios"
    548     elif type == 2:
    549         return "efi"
    550     elif type == 3:
    551         return "efi64"
    552     elif type == 4:
    553         return "efidual"
    554     else:
    555         return "Unknown"
    556 
    557 
    558545def asEnumElem(ctx,enum,elem):
    559546    all = ctx['ifaces'].all_values(enum)
     
    574561    print "  Name [name]: %s" %(mach.name)
    575562    print "  ID [n/a]: %s" %(mach.id)
    576     print "  OS Type [n/a]: %s" %(os.description)
     563    print "  OS Type [via OSTypeId]: %s" %(os.description)
    577564    print "  Firmware [firmwareType]: %s (%s)" %(asEnumElem(ctx,"FirmwareType", mach.firmwareType),mach.firmwareType)
    578565    print
     
    582569    print "  Monitors [monitorCount]: %d" %(mach.monitorCount)
    583570    print
    584     print "  Clipboard mode [clipboardMode]: %d" %(mach.clipboardMode)
    585     print "  Machine status [n/a]: %d" % (mach.sessionState)
     571    print "  Clipboard mode [clipboardMode]: %s (%s)" %(asEnumElem(ctx,"ClipboardMode", mach.clipboardMode), mach.clipboardMode)
     572    print "  Machine status [n/a]: %s (%s)" % (asEnumElem(ctx,"SessionState", mach.sessionState), mach.sessionState)
    586573    print
    587574    if mach.teleporterEnabled:
    588575        print "  Teleport target on port %d (%s)" %(mach.teleporterPort, mach.teleporterPassword)
    589     print
     576        print
    590577    bios = mach.BIOSSettings
    591578    print "  ACPI [BIOSSettings.ACPIEnabled]: %s" %(asState(bios.ACPIEnabled))
     
    621608        print "  Mediums:"
    622609    for a in attaches:
    623         print "   Controller: %s port: %d device: %d type: %s:" % (a.controller, a.port, a.device, a.type)
     610        print "   Controller: %s port: %d device: %d type: %s (%s):" % (a.controller, a.port, a.device, asEnumElem(ctx,"DeviceType", a.type), a.type)
    624611        m = a.medium
    625612        if a.type == ctx['global'].constants.DeviceType_HardDisk:
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