vboxapi.py revision 5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4
5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4vboxsync# Copyright (C) 2009 Sun Microsystems, Inc.
5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4vboxsync# available from http://www.virtualbox.org. This file is free software;
5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4vboxsync# you can redistribute it and/or modify it under the terms of the GNU
5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4vboxsync# General Public License (GPL) as published by the Free Software
5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4vboxsync# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4vboxsync# Clara, CA 95054 USA or visit http://www.sun.com if you need
5f40efb5cd27c6ff21ca70bf3271564e7e79e3a4vboxsync# additional information or have any questions.
08122b11035de1e54ce1e665dff7260fc548db72vboxsyncVboxBinDir = os.environ.get("VBOX_PROGRAM_PATH", None)
08122b11035de1e54ce1e665dff7260fc548db72vboxsync # @todo: To be set by installer
08122b11035de1e54ce1e665dff7260fc548db72vboxsync VboxBinDir = "/home/nike/work/ws/out/linux.amd64/debug/bin/"
08122b11035de1e54ce1e665dff7260fc548db72vboxsync self.__dict__['_depth']=parent.__dict__['_depth']+1
08122b11035de1e54ce1e665dff7260fc548db72vboxsync if fake != None:
da570ef57fe454ae2d9d5d88a7bfea214723dbb1vboxsync self.__dict__['_rootFake'] = PlatformMSCOM.ConstantFake(None, None)
08122b11035de1e54ce1e665dff7260fc548db72vboxsync while parent != None:
08122b11035de1e54ce1e665dff7260fc548db72vboxsync if name is not None:
08122b11035de1e54ce1e665dff7260fc548db72vboxsync sys.path.append(VboxSdkDir+'/bindings/mscom/python/')
08122b11035de1e54ce1e665dff7260fc548db72vboxsync from win32com.client import gencache, DispatchWithEvents, Dispatch
2ea0ec406117609d51bd5ac51cbb3d4f0de9a16dvboxsync #win32com.client.gencache.EnsureDispatch('VirtualBox.Session')
2ea0ec406117609d51bd5ac51cbb3d4f0de9a16dvboxsync #win32com.client.gencache.EnsureDispatch('VirtualBox.VirtualBox')
2ea0ec406117609d51bd5ac51cbb3d4f0de9a16dvboxsync return win32com.client.Dispatch("VirtualBox.Session")
2ea0ec406117609d51bd5ac51cbb3d4f0de9a16dvboxsync return win32com.client.Dispatch("VirtualBox.VirtualBox")
08122b11035de1e54ce1e665dff7260fc548db72vboxsync return 'MSCOM'
08122b11035de1e54ce1e665dff7260fc548db72vboxsync sys.path.append(VboxSdkDir+'/bindings/xpcom/python/')
08122b11035de1e54ce1e665dff7260fc548db72vboxsync return xpcom.components.classes["@virtualbox.org/Session;1"].createInstance()
08122b11035de1e54ce1e665dff7260fc548db72vboxsync return xpcom.components.classes["@virtualbox.org/VirtualBox;1"].createInstance()
08122b11035de1e54ce1e665dff7260fc548db72vboxsync return 'XPCOM'
08122b11035de1e54ce1e665dff7260fc548db72vboxsync sys.path.append(VboxSdkDir+'/bindings/webservice/python/lib')
08122b11035de1e54ce1e665dff7260fc548db72vboxsync return 'WEBSERVICE'
08122b11035de1e54ce1e665dff7260fc548db72vboxsync exec "self.platform = Platform"+style+"(platparams)"
08122b11035de1e54ce1e665dff7260fc548db72vboxsync print "init exception: ",e