gnome-specimen r75 - in branches/import-from-bzr: . specimen



Author: wbolster
Date: Tue Jun 17 18:53:08 2008
New Revision: 75
URL: http://svn.gnome.org/viewvc/gnome-specimen?rev=75&view=rev

Log:
* specimen/config.py.in:
  - Allow running gnome-specimen from the source directory
    (without installing into $prefix) by doing some path
    mangling in the config.py file.


Modified:
   branches/import-from-bzr/   (props changed)
   branches/import-from-bzr/specimen/config.py.in

Modified: branches/import-from-bzr/specimen/config.py.in
==============================================================================
--- branches/import-from-bzr/specimen/config.py.in	(original)
+++ branches/import-from-bzr/specimen/config.py.in	Tue Jun 17 18:53:08 2008
@@ -18,12 +18,27 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
 #
 
-import os.path
+from os.path import join, exists, dirname, realpath
 
 PACKAGE     = "@PACKAGE_NAME@"
 VERSION     = "@PACKAGE_VERSION@"
 
+# Don't bother using translations from the source directory (too much hassle,
+# if not impossible because of the $LANG/LC_MESSAGES directories)
 LOCALEDIR   = "@LOCALEDIR@"
-DATADIR     = "@DATADIR@"
-PKGDATADIR  = "@PKGDATADIR@"
-GLADEDIR    = "@GLADEDIR@"
+
+# Allow to run uninstalled by detecint gnome-specimen.in
+if exists(join(dirname(__file__), '../gnome-specimen.in')):
+    print "Running from source directory; not using installation paths!"
+
+    source_datadir = realpath(join(dirname(__file__), '../data'))
+
+    DATADIR     = source_datadir
+    PKGDATADIR  = source_datadir
+    GLADEDIR    = source_datadir
+
+# Normal situation: use installation paths from ./configure
+else:
+    DATADIR     = "@DATADIR@"
+    PKGDATADIR  = "@PKGDATADIR@"
+    GLADEDIR    = "@GLADEDIR@"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]