Lines Matching defs:name
375 self.orig_filename = filename # Original file name in archive
377 # Terminate the file name at the first null byte. Null bytes in file
388 self.filename = filename # Normalized file name
529 arcname is the name which it will have within the archive (by default,
842 self.name = zipinfo.filename
889 result.append(' name=%r mode=%r' % (self.name, self.mode))
976 raise BadZipFile("Bad CRC-32 for file %r" % self.name)
1260 self.NameToInfo = {} # Find file info given name
1297 self.filename = getattr(file, 'name', None)
1481 def getinfo(self, name):
1482 """Return the instance of ZipInfo given 'name'."""
1483 info = self.NameToInfo.get(name)
1486 'There is no item named %r in the archive' % name)
1517 def read(self, name, pwd=None):
1518 """Return file bytes for name."""
1519 with self.open(name, "r", pwd) as fp:
1522 def open(self, name, mode="r", pwd=None, *, force_zip64=False):
1523 """Return file-like object for 'name'.
1525 name is a string for the file name within the ZIP file, or a ZipInfo
1536 instance for name, with zinfo.file_size set.
1547 if isinstance(name, ZipInfo):
1548 # 'name' is already an info object
1549 zinfo = name
1551 zinfo = ZipInfo(name)
1555 # Get info object for name
1556 zinfo = self.getinfo(name)
1599 'File name in directory %r and header %r differ.'
1615 "required for extraction" % name)
1668 using its full name. Its file information is extracted as accurately
1757 warnings.warn('Duplicate name: %r' % zinfo.filename, stacklevel=3)
1778 """Put the bytes from filename into the archive under the name
1815 the name of the file in the archive."""
2041 dir, name = os.path.split(pathname)
2047 basename = "%s/%s" % (basename, name)
2049 basename = name
2106 Given a module name path, return the correct file path and
2107 archive name, compiling if necessary. For example, given
2135 # file name in the archive.
2141 # file name in the archive.
2147 # file name in the archive.
2248 def _sanitize(name):
2288 bare = re.sub('^([A-Z]):', r'\1', name, flags=re.IGNORECASE)
2294 return joined + '/' * name.endswith('/')
2316 def resolve_dir(self, name):
2318 If the name represents a directory, return that name
2322 dirname = name + '/'
2323 dir_match = name not in names and dirname in names
2324 return dirname if dir_match else name
2326 def getinfo(self, name):
2331 return super().getinfo(name)
2333 if not name.endswith('/') or name not in self._name_set():
2335 return ZipInfo(filename=name)
2415 name property:
2417 >>> b.name
2425 >>> c.name
2446 At the root, ``name``, ``filename``, and ``parent``
2451 >>> root.name
2495 def name(self):
2496 return pathlib.Path(self.at).name or self.filename.name
2578 metavar=('<name>', '<file>'),