Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
	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)
Ejemplo n.º 3
0
	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
Ejemplo n.º 4
0
 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
Ejemplo n.º 5
0
 def makewithhfspath(klass, path):
     return klass.makewithurl(convertpathtourl(path, kCFURLHFSPathStyle))
Ejemplo n.º 6
0
	def makewithhfspath(klass, path):
		return klass.makewithurl(convertpathtourl(path, kCFURLHFSPathStyle))