VirtualBox

Ignore:
Timestamp:
May 23, 2017 5:48:32 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
115695
Message:

Main/glue/vboxapi.py: clean up, remove vbox attribute, eliminate unnecessary parameter of getSessionObject (it is a completely ignored parameter with a default parameter to make life a little simpler for API clients in Python to deal with the previous version still)
Frontends/VBoxShell: adapt to the cleanup, reduce the unnecessary variations in the code dealing with sessions
ValidationKit etc.: adapt to the cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/webservice/samples/python/clienttest.py

    r62485 r67049  
    3939    from vboxapi import VirtualBoxManager
    4040    # This is a VirtualBox COM/XPCOM API client, no data needed.
    41     wrapper = VirtualBoxManager(None, None)
     41    mgr = VirtualBoxManager(None, None)
    4242
    43     # Get the VirtualBox manager
    44     mgr  = wrapper.mgr
    4543    # Get the global VirtualBox object
    46     vbox = wrapper.vbox
     44    vbox = mgr.getVirtualBox()
    4745
    4846    print "Running VirtualBox version %s" %(vbox.version)
    4947
    50     # Get all constants through the Python wrapper code
    51     vboxConstants = wrapper.constants
     48    # Get all constants through the Python manager code
     49    vboxConstants = mgr.constants
    5250
    5351    # Enumerate all defined machines
    54     for mach in wrapper.getArray(vbox, 'machines'):
     52    for mach in mgr.getArray(vbox, 'machines'):
    5553
    5654        try:
     
    8078
    8179                # Get the session object
    82                 session = mgr.getSessionObject(vbox)
     80                session = mgr.getSessionObject()
    8381
    8482                 # Lock the current machine (shared mode, since we won't modify the machine)
     
    111109            traceback.print_exc()
    112110
    113     # Call destructor and delete wrapper
    114     del wrapper
     111    # Call destructor and delete manager
     112    del mgr
    115113
    116114if __name__ == '__main__':
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette