def PathCheck(path):
 if isinstance(path, unicode):
  path = path.encode('utf-8')
 path = os.path.expanduser(path)
 if (not os.path.exists(path)):
  raise ValueError((_('File/directory does not exist: %s') % path))
 return os.path.abspath(path)

def PathCheck ( path ) : if isinstance ( path , unicode ) : path = path . encode ( 'utf-8' ) path = os . path . expanduser ( path ) if ( not os . path . exists ( path ) ) : raise ValueError ( ( _ ( 'File/directory does not exist: %s' ) % path ) ) return os . path . abspath ( path )
verify that a string is a valid path .