我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用setuptools.command.sdist.sdist.add_defaults()。
def write_manifest(self): """Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. """ # The manifest must be UTF-8 encodable. See #303. if sys.version_info >= (3,): files = [] for file in self.filelist.files: try: file.encode("utf-8") except UnicodeEncodeError: log.warn("'%s' not UTF-8 encodable -- skipping" % file) else: files.append(file) self.filelist.files = files files = self.filelist.files if os.sep!='/': files = [f.replace(os.sep,'/') for f in files] self.execute(write_file, (self.manifest, files), "writing manifest file '%s'" % self.manifest)
def add_defaults (self): old_sdist.add_defaults(self) dist = self.distribution if dist.has_data_files(): for data in dist.data_files: self.filelist.extend(get_data_files(data)) if dist.has_headers(): headers = [] for h in dist.headers: if isinstance(h, str): headers.append(h) else: headers.append(h[1]) self.filelist.extend(headers) return
def write_manifest (self): """Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. """ # The manifest must be UTF-8 encodable. See #303. if sys.version_info >= (3,): files = [] for file in self.filelist.files: try: file.encode("utf-8") except UnicodeEncodeError: log.warn("'%s' not UTF-8 encodable -- skipping" % file) else: files.append(file) self.filelist.files = files files = self.filelist.files if os.sep!='/': files = [f.replace(os.sep,'/') for f in files] self.execute(write_file, (self.manifest, files), "writing manifest file '%s'" % self.manifest)
def run(self): self.filelist = FileList() if not os.path.exists(self.manifest): self.write_manifest() # it must exist so it'll get in the list self.add_defaults() if os.path.exists(self.template): self.read_template() self.prune_file_list() self.filelist.sort() self.filelist.remove_duplicates() self.write_manifest()
def add_defaults(self): sdist.add_defaults(self) self.filelist.append(self.template) self.filelist.append(self.manifest) rcfiles = list(walk_revctrl()) if rcfiles: self.filelist.extend(rcfiles) elif os.path.exists(self.manifest): self.read_manifest() ei_cmd = self.get_finalized_command('egg_info') self.filelist.graft(ei_cmd.egg_info)
def run(self): self.filelist = FileList() if not os.path.exists(self.manifest): self.write_manifest() # it must exist so it'll get in the list self.filelist.findall() self.add_defaults() if os.path.exists(self.template): self.read_template() self.prune_file_list() self.filelist.sort() self.filelist.remove_duplicates() self.write_manifest()
def add_defaults(self): sdist.add_defaults(self) self.filelist.append(self.template) self.filelist.append(self.manifest) rcfiles = list(walk_revctrl()) if rcfiles: self.filelist.extend(rcfiles) elif os.path.exists(self.manifest): self.read_manifest() ei_cmd = self.get_finalized_command('egg_info') self.filelist.include_pattern("*", prefix=ei_cmd.egg_info)
def add_defaults(self): sdist.add_defaults(self) self.filelist.append(self.template) self.filelist.append(self.manifest) rcfiles = list(walk_revctrl()) if rcfiles: self.filelist.extend(rcfiles) elif os.path.exists(self.manifest): self.read_manifest() ei_cmd = self.get_finalized_command('egg_info') self._add_egg_info(cmd=ei_cmd) self.filelist.include_pattern("*", prefix=ei_cmd.egg_info)