VirtualBox

Changeset 11852 in vbox for trunk/src


Ignore:
Timestamp:
Aug 29, 2008 10:30:07 PM (16 years ago)
Author:
vboxsync
Message:

Python on the mac.

Location:
trunk/src/libs/xpcom18a4/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/python/sample/vboxshell.py

    r11848 r11852  
    2121# To allow library resolution
    2222#  export LD_LIBRARY_PATH=$VBOX_PROGRAM_PATH
     23#
    2324# Additionally, on 64-bit Solaris, you need to use 64-bit Python from
    2425# /usr/bin/amd64/python and due to quirks in native modules loading of
     
    2627#   mkdir $VBOX_PROGRAM_PATH/64
    2728#   ln -s $VBOX_PROGRAM_PATH/VBoxPython.so $VBOX_PROGRAM_PATH/64/VBoxPython.so
     29#
     30# Mac OS X users can get away with just this:
     31#   export PYTHONPATH=$VBOX_SDK/bindings/xpcom/python:$PYTHONPATH
     32# , where $VBOX_SDK is is replaced with the place you unzipped the SDK
     33# or <trunk>/out/darwin.x86/release/dist/sdk.
     34
    2835#
    2936import traceback
  • trunk/src/libs/xpcom18a4/python/vboxxpcom.py

    r11746 r11852  
    1717import xpcom
    1818import sys
     19import platform
    1920
    2021# this code overcomes somewhat unlucky feature of Python, where it searches
     
    2223# rest of Python bindings expect _xpcom to be inside xpcom module
    2324# XXX: maybe implement per Python version module search
    24 cglue = __import__('VBoxPython')
     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') 
    2534sys.modules['xpcom._xpcom'] = cglue
    2635xpcom._xpcom = cglue
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