[Synopsis-changes] Synopsis/Synopsis/Synopsis config.py,1.1,1.2

Stefan Seefeld stefan at synopsis.fresco.org
Tue Nov 18 16:44:14 UTC 2003


Update of /cvs/synopsis/Synopsis/Synopsis
In directory frida:/tmp/cvs-serv13705/Synopsis

Modified Files:
	config.py 
Log Message:
enhance the logic to find 'datadir'. It's still not perfect...

Index: config.py
===================================================================
RCS file: /cvs/synopsis/Synopsis/Synopsis/config.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -d -r1.1 -r1.2
--- config.py	15 Nov 2003 18:35:28 -0000	1.1
+++ config.py	18 Nov 2003 16:44:11 -0000	1.2
@@ -2,8 +2,30 @@
 particular release / installation such as version, data
 paths, etc."""
 
-import os, os.path
+import os, os.path, sys
 
-datadir = os.path.abspath(os.path.join(__file__,
-                                       os.pardir, os.pardir,
-                                       'share', 'Synopsis'))
+if os.name == "posix":
+   datadir = os.path.abspath(os.path.join(__file__,
+                                          # lib / pythonx.y / site-packages / Synopsis / config.py
+                                          os.pardir, os.pardir, os.pardir, os.pardir, os.pardir,
+                                          'share', 'Synopsis'))
+elif os.name == "nt":
+   datadir = os.path.abspath(os.path.join(__file__,
+                                          # lib / site-packages / Synopsis / config.py
+                                          os.pardir, os.pardir, os.pardir, os.pardir,
+                                          'share', 'Synopsis'))
+
+elif os.name == "mac":
+   datadir = os.path.abspath(os.path.join(__file__,
+                                          # lib / site-packages / Synopsis / config.py
+                                          os.pardir, os.pardir, os.pardir, os.pardir,
+                                          'share', 'Synopsis'))
+
+if not os.path.exists(datadir) or not os.path.isdir(datadir):
+   # for now lets assume this is called from within the source tree
+   # we need a more robust way to deal with this whole issue, though
+   # --stefan
+
+   datadir = os.path.abspath(os.path.join(__file__,
+                                          os.pardir, os.pardir,
+                                          'share', 'Synopsis'))





More information about the Synopsis-changes mailing list