VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/python/vboxxpcom.py@ 11852

Last change on this file since 11852 was 11852, checked in by vboxsync, 17 years ago

Python on the mac.

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1#
2# Copyright (C) 2008 Sun Microsystems, Inc.
3#
4# This file is part of VirtualBox Open Source Edition (OSE), as
5# available from http://www.virtualbox.org. This file is free software;
6# you can redistribute it and/or modify it under the terms of the GNU
7# General Public License (GPL) as published by the Free Software
8# Foundation, in version 2 as it comes in the "COPYING" file of the
9# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
10# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
11#
12# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
13# Clara, CA 95054 USA or visit http://www.sun.com if you need
14# additional information or have any questions.
15#
16
17import xpcom
18import sys
19import platform
20
21# this code overcomes somewhat unlucky feature of Python, where it searches
22# for binaries in the same place as platfom independent modules, while
23# rest of Python bindings expect _xpcom to be inside xpcom module
24# XXX: maybe implement per Python version module search
25#cglue = __import__('VBoxPython')
26if platform.system() == 'Darwin':
27 # TODO: This needs to be changed if it is supposed to work with OSE as well.
28 saved_sys_path = sys.path;
29 sys.path = [ '/Applications/VirtualBox.app/Contents/MacOS', ] + saved_sys_path
30 cglue = __import__('VBoxPython')
31 sys.path = saved_sys_path
32else:
33 cglue = __import__('VBoxPython')
34sys.modules['xpcom._xpcom'] = cglue
35xpcom._xpcom = cglue
Note: See TracBrowser for help on using the repository browser.

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