[gnome-schedule] dynamically determine line of file



commit f1070f2e46fb5c67aa4c3ad89df44199d07c6373
Author: Gaute Hope <eg gaute vetsj com>
Date:   Fri Jul 26 01:12:30 2013 +0200

    dynamically determine line of file

 src/lang.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/lang.py b/src/lang.py
index 2c834f6..0cc2db5 100644
--- a/src/lang.py
+++ b/src/lang.py
@@ -23,6 +23,8 @@
 # editor (and tested everything, haha)
 
 # python modules
+import inspect
+import sys
 import time
 import warnings
 warnings.filterwarnings("once", "Locale not supported by Python. Using the fallback 'C' locale.")
@@ -88,7 +90,7 @@ else:
 try:
     locale.setlocale(locale.LC_ALL, language)
 except:
-    warnings.warn_explicit("Locale not supported by Python. Using the fallback 'C' locale.", Warning, 
"lang.py", "68")
+    warnings.warn_explicit("Locale not supported by Python. Using the fallback 'C' locale.", Warning, 
"lang.py", sys.exc_info()[2].tb_frame.f_back.f_lineno)
 
 encoding = locale.getpreferredencoding(False)
 language = locale.getlocale()[0]


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