[Jahshaka-cvs] jah/jahplayer utilities.py,1.14,1.15
Status: Beta
Brought to you by:
jahshaka
From: Goncalo N. M. de C. <gl...@us...> - 2006-10-10 21:38:57
|
Update of /cvsroot/jahshaka/jah/jahplayer In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23956 Modified Files: utilities.py Log Message: +OSX path updates. Assumes that a development environment wont install the actual package in /Applications. To be tested on the released machines... Index: utilities.py =================================================================== RCS file: /cvsroot/jahshaka/jah/jahplayer/utilities.py,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- utilities.py 15 Sep 2006 16:16:42 -0000 1.14 +++ utilities.py 10 Oct 2006 21:38:54 -0000 1.15 @@ -36,7 +36,18 @@ def printobj( obj ): print obj def get_absolute_path( filename ): - return os.path.join( os.path.abspath( sys.path[ 0 ] ), filename ).replace( '\\', '/' ) + path = sys.path[ 0 ]; + if platform.system( ) == "Darwin": + import Carbon.File, Carbon.Folder, Carbon.Folders + import MacOS + try: + fsref = Carbon.Folder.FSFindFolder( Carbon.Folders.kOnAppropriateDisk, Carbon.Folders.kApplicationsFolderType, False ) + path = os.path.join( Carbon.File.pathname( fsref ), "jahplayer.app/Contents/Resources" ) + if not os.access( path, os.F_OK ): + path = sys.path[ 0 ] + except MacOS.Error: + path = sys.path[ 0 ] + return os.path.join( os.path.abspath( path ), filename ).replace( '\\', '/' ) def get_absolute_reel( filename ): path = "" |