Changeset 12207 in vbox for trunk/src/libs/xpcom18a4/python
- Timestamp:
- Sep 8, 2008 9:02:22 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/python/vboxxpcom.py
r11905 r12207 22 22 # for binaries in the same place as platfom independent modules, while 23 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') 24 25 candidates = ['VBoxPython' + str(sys.version_info[0]) + '_' + str(sys.version_info[1]), 26 'VBoxPython' + str(sys.version_info[0]), 27 'VBoxPython'] 26 28 if platform.system() == 'Darwin': 27 29 # On Darwin (aka Mac OS X) we know exactly where things are in a normal … … 33 35 # be to to sed the file during install and inject the VBOX_PATH_APP_PRIVATE_ARCH 34 36 # and VBOX_PATH_SHARED_LIBS when these are set. 35 saved_sys_path = sys.path; 36 sys.path = [ '/Applications/VirtualBox.app/Contents/MacOS', ] + saved_sys_path 37 mod = 'VBoxPython' + str(sys.version_info[0]) + '_' + str(sys.version_info[1]) 38 cglue = __import__(mod) 39 sys.path = saved_sys_path 40 else: 41 cglue = __import__('VBoxPython') 37 sys.path.append('/Applications/VirtualBox.app/Contents/MacOS') 38 39 cglue = None 40 for m in candidates: 41 try: 42 cglue = __import__(m) 43 break 44 except: 45 pass 46 47 if platform.system() == 'Darwin': 48 sys.path.remove('/Applications/VirtualBox.app/Contents/MacOS') 49 50 if cglue == None: 51 raise Exception, "Cannot find VBoxPython module" 52 42 53 sys.modules['xpcom._xpcom'] = cglue 43 54 xpcom._xpcom = cglue
Note:
See TracChangeset
for help on using the changeset viewer.