def __init__(self, path): """Make File object from POSIX path.""" if path is not _kNoPath: if not isinstance(path, unicode): path = unicode(path) self._path = abspath(path) self._url = convertpathtourl(self._path, kCFURLPOSIXPathStyle) self._desc = newdesc(kae.typeFileURL, self._url)
def __init__(self, path): """Make Alias object from POSIX path.""" if path is _kNoPath: self._desc = None else: urldesc = newdesc(kae.typeFileURL, convertpathtourl(abspath(path), kCFURLPOSIXPathStyle)) try: self._desc = urldesc.coerce(kae.typeAlias) except MacOSError, err: if err.args[0] == -1700: raise ValueError("Can't make mactypes.Alias as file doesn't exist: %r" % path) else: raise
def __init__(self, path): """Make Alias object from POSIX path.""" if path is _kNoPath: self._desc = None else: urldesc = newdesc( kae.typeFileURL, convertpathtourl(abspath(path), kCFURLPOSIXPathStyle)) try: self._desc = urldesc.coerce(kae.typeAlias) except MacOSError, err: if err.args[0] == -1700: raise ValueError( "Can't make mactypes.Alias as file doesn't exist: %r" % path) else: raise
def makewithhfspath(klass, path): return klass.makewithurl(convertpathtourl(path, kCFURLHFSPathStyle))