Windows port: Do not append '/usr/share' to _xdg_data_dirs...
authorDieter Verfaillie <dieterv@optionexplicit.be>
Mon, 5 Sep 2011 15:49:45 +0000 (17:49 +0200)
committerDieter Verfaillie <dieterv@optionexplicit.be>
Wed, 7 Sep 2011 20:00:29 +0000 (22:00 +0200)
... on Windows as it points to the MinGW installation directory,
which doesn't have any .gir files to start with anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=620566

giscanner/transformer.py

index 74985ff..4ce2ac0 100644 (file)
@@ -38,8 +38,12 @@ class TransformerException(Exception):
     pass
 
 
-_xdg_data_dirs = [x for x in os.environ.get('XDG_DATA_DIRS', '').split(':') \
-                      + [DATADIR, '/usr/share'] if x]
+_xdg_data_dirs = [x for x in os.environ.get('XDG_DATA_DIRS', '').split(os.pathsep)]
+_xdg_data_dirs.append(DATADIR)
+
+if os.name != 'nt':
+    _xdg_data_dirs.append('/usr/share')
+
 
 class Transformer(object):
     namespace = property(lambda self: self._namespace)