VirtualBox

Changeset 48285 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 5, 2013 12:58:07 AM (11 years ago)
Author:
vboxsync
Message:

vboxshell.py: Fixed some bustage and improved the path autodetection.

File:
1 edited

Legend:

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

    r47981 r48285  
    207207    oVBoxMgr = _ctx['global'];
    208208    if oVBoxMgr.errIsOurXcptKind(e):
    209         print colored('%s: %s' % (oVBoxMgr.errToString(e), oVBoxMgr.errGetMessage(e)), 'red');
     209        print colored('%s: %s' % (oVBoxMgr.xcptToString(e), oVBoxMgr.xcptGetMessage(e)), 'red');
    210210    else:
    211211        print colored(str(e), 'red')
     
    845845    def enum(self):
    846846        return [XPathNodeHolderNIC(self, self.obj),
    847                 XPathNodeValue(self, self.obj.BIOSSettings,  'bios'),
    848                 XPathNodeValue(self, self.obj.USBController, 'usb')]
     847                XPathNodeValue(self, self.obj.BIOSSettings,  'bios'), ]
    849848
    850849class XPathNodeHolderNIC(XPathNodeHolder):
     
    992991    if mach.audioAdapter.enabled:
    993992        print "  Audio [via audioAdapter]: chip %s; host driver %s" % (asEnumElem(ctx, "AudioControllerType", mach.audioAdapter.audioController), asEnumElem(ctx, "AudioDriverType",  mach.audioAdapter.audioDriver))
    994     if mach.USBController.enabled:
    995         print "  USB [via USBController]: high speed %s" % (asState(mach.USBController.enabledEHCI))
    996993    print "  CPU hotplugging [CPUHotPlugEnabled]: %s" % (asState(mach.CPUHotPlugEnabled))
    997994
     
    10041001    except:
    10051002        pass
     1003
     1004    print
     1005    print colCat(ctx, "  USB Controllers:")
     1006    for oUsbCtrl in ctx['global'].getArray(mach, 'USBControllers'):
     1007        print "    '%s': type %s  standard: %#x" \
     1008            % (oUsbCtrl.name, asEnumElem(ctx, "USBControllerType", oUsbCtrl.type), oUsbCtrl.USBStandard);
     1009
    10061010    print
    10071011    print colCat(ctx, "  I/O subsystem info:")
     
    10121016    if controllers:
    10131017        print
    1014         print colCat(ctx, "  Controllers:")
     1018        print colCat(ctx, "  Storage Controllers:")
    10151019    for controller in controllers:
    10161020        print "    '%s': bus %s type %s" % (controller.name, asEnumElem(ctx, "StorageBus", controller.bus), asEnumElem(ctx, "StorageControllerType", controller.controllerType))
     
    35243528
    35253529    if options.autopath:
    3526         cwd = os.getcwd()
     3530        asLocations = [ os.getcwd(), ];
     3531        try:    sScriptDir = os.path.dirname(os.path.abspath(__file__));
     3532        except: pass; # In case __file__ isn't there.
     3533        else:
     3534            if platform.system() in [ 'SunOS', ]:
     3535                asLocations.append(os.path.join(sScriptDir, 'amd64'));
     3536            asLocations.append(sScriptDir);
     3537
     3538
    35273539        vpp = os.environ.get("VBOX_PROGRAM_PATH")
    3528         if    vpp is None \
    3529           and (   os.path.isfile(os.path.join(cwd, "VirtualBox")) \
    3530                or os.path.isfile(os.path.join(cwd, "VirtualBox.exe")) ):
    3531             vpp = cwd
    3532             print "Autodetected VBOX_PROGRAM_PATH as", vpp
    3533             os.environ["VBOX_PROGRAM_PATH"] = vpp
    3534             sys.path.append(os.path.join(vpp, "sdk", "installer"))
     3540        if vpp is None:
     3541            for sCurLoc in asLocations:
     3542                print "checking '%s'..." % (sCurLoc,)
     3543
     3544                if   os.path.isfile(os.path.join(sCurLoc, "VirtualBox")) \
     3545                  or os.path.isfile(os.path.join(sCurLoc, "VirtualBox.exe")):
     3546                    print "Autodetected VBOX_PROGRAM_PATH as", sCurLoc
     3547                    os.environ["VBOX_PROGRAM_PATH"] = sCurLoc
     3548                    sys.path.append(os.path.join(sCurLoc, "sdk", "installer"))
     3549
    35353550        vsp = os.environ.get("VBOX_SDK_PATH")
    3536         if vsp is None and os.path.isfile(os.path.join(cwd, "sdk", "bindings", "VirtualBox.xidl")) :
    3537             vsp = os.path.join(cwd, "sdk")
    3538         if vsp is None and vpp is not None and os.path.isfile(os.path.join(vpp, "sdk", "bindings", "VirtualBox.xidl")) :
    3539             vsp = os.path.join(vpp, "sdk")
    3540         if vsp is not None :
    3541             print "Autodetected VBOX_SDK_PATH as", vsp
    3542             os.environ["VBOX_SDK_PATH"] = vsp
     3551        if vsp is None:
     3552            for sCurLoc in asLocations:
     3553                if os.path.isfile(os.path.join(sCurLoc, "sdk", "bindings", "VirtualBox.xidl")):
     3554                    print "Autodetected VBOX_SDK_PATH as", sCurLoc
     3555                    os.environ["VBOX_SDK_PATH"] = sCurLoc
     3556                    sTmp = os.path.join(sCurLoc, 'sdk', 'bindings', 'xpcom', 'python');
     3557                    if os.path.isdir(sTmp):
     3558                        sys.path.append(sTmp);
     3559                    del sTmp;
     3560        del vsp, vpp, asLocations;
     3561
    35433562
    35443563    #
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