Пример #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)
Пример #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)
Пример #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
Пример #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
Пример #5
0
 def makewithhfspath(klass, path):
     return klass.makewithurl(convertpathtourl(path, kCFURLHFSPathStyle))
Пример #6
0
	def makewithhfspath(klass, path):
		return klass.makewithurl(convertpathtourl(path, kCFURLHFSPathStyle))