[pitivi] bin: Make localedir a local variable in the pitivi script



commit 2e01875f67f6baec1cb240c9686ee0459b940b0e
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sat Apr 12 07:45:53 2014 +0200

    bin: Make localedir a local variable in the pitivi script

 bin/pitivi.in |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/bin/pitivi.in b/bin/pitivi.in
index db85717..62b9887 100644
--- a/bin/pitivi.in
+++ b/bin/pitivi.in
@@ -26,7 +26,6 @@ import string
 import locale
 import gettext
 
-localedir = ""
 if "APPDIR" in os.environ:
     basedir = os.environ["APPDIR"]
     CONFIGURED_PYTHONPATH = ""
@@ -61,9 +60,7 @@ def _in_devel():
 
 
 def _add_pitivi_path():
-    global localedir
     dir = os.path.dirname(os.path.abspath(__file__))
-    root = None
     if _in_devel():
         root = os.path.split(dir)[0]
         sys.path.insert(0, os.path.join(root, "pitivi", "coptimizations",
@@ -88,13 +85,13 @@ def _add_pitivi_path():
         locale.setlocale(locale.LC_ALL, '')
         locale.bindtextdomain('pitivi', localedir)
         locale.textdomain('pitivi')
-    except:
-        print("Couldn't set locale.")
+    except Exception as e:
+        print("Couldn't set locale.", localedir, e)
     try:
         gettext.bindtextdomain('pitivi', localedir)
         gettext.textdomain('pitivi')
-    except:
-        print("Couldn't set the gettext domain. Translations will not work.")
+    except Exception as e:
+        print("Couldn't set the gettext domain. Translations will not work.", localedir, e)
 
     if CONFIGURED_LD_LIBRARY_PATH or CONFIGURED_GST_PLUGIN_PATH:
         _prepend_env_path("LD_LIBRARY_PATH", [CONFIGURED_LD_LIBRARY_PATH])


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