Edouard@725: """
Edouard@725: Misc definitions
Edouard@725: """
Edouard@725: 
Edouard@725: import os,sys
laurent@806: 
Edouard@725: # helper func to check path write permission
Edouard@725: def CheckPathPerm(path):
Edouard@725:     if path is None or not os.path.isdir(path):
Edouard@725:         return False
Edouard@725:     for root, dirs, files in os.walk(path):
Edouard@725:          for name in files:
Edouard@725:              if os.access(root, os.W_OK) is not True or os.access(os.path.join(root, name), os.W_OK) is not True:
Edouard@725:                  return False
Edouard@725:     return True
Edouard@725: 
Edouard@725: def GetClassImporter(classpath):
Edouard@725:     if type(classpath)==str:
Edouard@725:         def fac():
Edouard@725:             mod=__import__(classpath.rsplit('.',1)[0])
Edouard@725:             return reduce(getattr, classpath.split('.')[1:], mod)
Edouard@725:         return fac
Edouard@725:     else:
Edouard@731:         return classpath