From: Kevin A. <ka...@us...> - 2007-07-28 14:56:47
|
Update of /cvsroot/pythoncard/PythonCard In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31378 Modified Files: util.py Log Message: moved code to find Python documentation (pythonDocumentationURL) to util.py Index: util.py =================================================================== RCS file: /cvsroot/pythoncard/PythonCard/util.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** util.py 18 May 2006 21:11:49 -0000 1.39 --- util.py 28 Jul 2007 14:56:43 -0000 1.40 *************** *** 120,123 **** --- 120,146 ---- return url + def pythonDocumentationURL(): + help_url = "http://docs.python.org/" + if sys.platform.startswith("win"): + fn = os.path.dirname(os.__file__) + fn = os.path.join(fn, os.pardir, "Doc", "index.html") + fn = os.path.normpath(fn) + if os.path.isfile(fn): + help_url = fn + del fn + elif sys.platform == 'darwin': + fn = '/Library/Frameworks/Python.framework/Versions/' + \ + 'Current/Resources/English.lproj/Documentation/index.html' + if os.path.exists(fn): + help_url = "file://" + fn + else: + fn = '/Library/Frameworks/Python.framework/Versions/' + \ + 'Current/Resources/Python.app/Contents/Resources/English.lproj/' + \ + 'PythonDocumentation/index.html' + if os.path.exists(fn): + help_url = "file://" + fn + return help_url + + def dirwalk(dir, patterns=['*'], recurse=1): """walk a directory tree, using a generator |