util/misc.py
changeset 806 abf1afc1f04d
parent 781 cdc6393705ce
child 814 5743cbdff669
equal deleted inserted replaced
805:c0f60c2a5a24 806:abf1afc1f04d
     1 """
     1 """
     2 Misc definitions
     2 Misc definitions
     3 """
     3 """
     4 
     4 
     5 import os,sys
     5 import os,sys
     6     
     6 
       
     7 from TextViewer import TextViewer
       
     8 
     7 # helper func to check path write permission
     9 # helper func to check path write permission
     8 def CheckPathPerm(path):
    10 def CheckPathPerm(path):
     9     if path is None or not os.path.isdir(path):
    11     if path is None or not os.path.isdir(path):
    10         return False
    12         return False
    11     for root, dirs, files in os.walk(path):
    13     for root, dirs, files in os.walk(path):
    21             return reduce(getattr, classpath.split('.')[1:], mod)
    23             return reduce(getattr, classpath.split('.')[1:], mod)
    22         return fac
    24         return fac
    23     else:
    25     else:
    24         return classpath
    26         return classpath
    25 
    27 
       
    28 class IECCodeViewer(TextViewer):
       
    29     
       
    30     def __del__(self):
       
    31         TextViewer.__del__(self)
       
    32         if getattr(self, "_OnClose"):
       
    33             self._OnClose(self)