[meld] meld: Add awful hack to compile gschemas at runtime if they're missing



commit ec0705d43cbabc9344ddfc15354a949c31ee0ecb
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Dec 7 08:31:51 2013 +1000

    meld: Add awful hack to compile gschemas at runtime if they're missing

 bin/meld |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/bin/meld b/bin/meld
index 6fea672..f52b8ef 100755
--- a/bin/meld
+++ b/bin/meld
@@ -22,6 +22,7 @@ from __future__ import print_function
 import locale
 import logging
 import os
+import subprocess
 import sys
 
 # On Windows, pythonw.exe (which doesn't display a console window) supplies
@@ -155,6 +156,16 @@ def setup_resources():
     Gtk.rc_parse(rc_file)
 
 
+def setup_settings():
+    if not uninstalled:
+        return
+
+    if os.path.exists(os.path.join(meld.conf.DATADIR, "gschemas.compiled")):
+        return
+
+    subprocess.call(["glib-compile-schemas", meld.conf.DATADIR], cwd=melddir)
+
+
 def setup_logging():
     log = logging.getLogger()
 
@@ -175,6 +186,7 @@ if __name__ == '__main__':
     setup_logging()
     disable_stdout_buffering()
     check_requirements()
+    setup_settings()
     setup_resources()
 
     import meld.meldapp


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