diff -r 31e63e25b4cc -r 64beb9e9c749 util/misc.py --- a/util/misc.py Mon Aug 21 20:17:19 2017 +0000 +++ b/util/misc.py Mon Aug 21 23:22:58 2017 +0300 @@ -26,10 +26,12 @@ Misc definitions """ -import os,sys +import os +import sys -# helper func to check path write permission + def CheckPathPerm(path): + """ Helper func to check path write permission """ if path is None or not os.path.isdir(path): return False for root, dirs, files in os.walk(path): @@ -40,15 +42,17 @@ return False return True + def GetClassImporter(classpath): - if type(classpath)==str: + if type(classpath) == str: def fac(): - mod=__import__(classpath.rsplit('.',1)[0]) + mod = __import__(classpath.rsplit('.', 1)[0]) return reduce(getattr, classpath.split('.')[1:], mod) return fac else: return classpath + def InstallLocalRessources(CWD): from BitmapLibrary import AddBitmapFolder from TranslationCatalogs import AddCatalog @@ -61,6 +65,5 @@ AddCatalog(os.path.join(CWD, "locale")) import gettext import __builtin__ - + __builtin__.__dict__['_'] = wx.GetTranslation -