Changeset 67049 in vbox for trunk/src/VBox/Main/webservice/samples/python
- Timestamp:
- May 23, 2017 5:48:32 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 115695
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/webservice/samples/python/clienttest.py
r62485 r67049 39 39 from vboxapi import VirtualBoxManager 40 40 # This is a VirtualBox COM/XPCOM API client, no data needed. 41 wrapper = VirtualBoxManager(None, None)41 mgr = VirtualBoxManager(None, None) 42 42 43 # Get the VirtualBox manager44 mgr = wrapper.mgr45 43 # Get the global VirtualBox object 46 vbox = wrapper.vbox44 vbox = mgr.getVirtualBox() 47 45 48 46 print "Running VirtualBox version %s" %(vbox.version) 49 47 50 # Get all constants through the Python wrapper code51 vboxConstants = wrapper.constants48 # Get all constants through the Python manager code 49 vboxConstants = mgr.constants 52 50 53 51 # Enumerate all defined machines 54 for mach in wrapper.getArray(vbox, 'machines'):52 for mach in mgr.getArray(vbox, 'machines'): 55 53 56 54 try: … … 80 78 81 79 # Get the session object 82 session = mgr.getSessionObject( vbox)80 session = mgr.getSessionObject() 83 81 84 82 # Lock the current machine (shared mode, since we won't modify the machine) … … 111 109 traceback.print_exc() 112 110 113 # Call destructor and delete wrapper114 del wrapper111 # Call destructor and delete manager 112 del mgr 115 113 116 114 if __name__ == '__main__':
Note:
See TracChangeset
for help on using the changeset viewer.