util/misc.py
changeset 815 e4f24593a758
parent 814 5743cbdff669
child 1388 67c9a9482d24
equal deleted inserted replaced
814:5743cbdff669 815:e4f24593a758
     1 """
     1 """
     2 Misc definitions
     2 Misc definitions
     3 """
     3 """
     4 
     4 
     5 import os,sys
     5 import os,sys
     6 
       
     7 from editors.TextViewer import TextViewer
       
     8 
     6 
     9 # helper func to check path write permission
     7 # helper func to check path write permission
    10 def CheckPathPerm(path):
     8 def CheckPathPerm(path):
    11     if path is None or not os.path.isdir(path):
     9     if path is None or not os.path.isdir(path):
    12         return False
    10         return False
    22             mod=__import__(classpath.rsplit('.',1)[0])
    20             mod=__import__(classpath.rsplit('.',1)[0])
    23             return reduce(getattr, classpath.split('.')[1:], mod)
    21             return reduce(getattr, classpath.split('.')[1:], mod)
    24         return fac
    22         return fac
    25     else:
    23     else:
    26         return classpath
    24         return classpath
    27 
       
    28 class IECCodeViewer(TextViewer):
       
    29     
       
    30     def __del__(self):
       
    31         TextViewer.__del__(self)
       
    32         if getattr(self, "_OnClose"):
       
    33             self._OnClose(self)