def get_file_list(self): ''' get_file_list ''' print("Chosen packaging option: " + NAME) self.distribution.data_files = DATA_FILES _sdist.get_file_list(self)
def get_file_list (self): """Figure out the list of files to include in the source distribution, and put it in 'self.filelist'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depend """ print("get_file_list...") _sdist.get_file_list(self) print("files: {0}".format(self.filelist.files))
def get_file_list(self): """Extends the file list read from the manifest with the sources of Yayi""" _sdist.get_file_list(self) # including the CGal archive without being forced to use the Manifest self.filelist.append(CGAL_archive) # distributing the tests files without being forced to use the Manifest for i in os.listdir(convert_path('tests')): if os.path.splitext(i)[1] == ".py": self.filelist.append(convert_path(os.path.join('tests', i))) log.info('[SDIST] file list is:') for f in self.filelist.files: log.info('[SDIST] \t"%s"', f) return
def get_file_list(self): try: from distutils.errors import DistutilsModuleError import subprocess p = subprocess.Popen(['hg', 'manifest'], stdout=subprocess.PIPE) exitcode = p.wait() if exitcode != 0: raise DistutilsModuleError("Mercurial exited with non-zero " "exit code: %d" % exitcode) files = p.stdout.read().strip().split('\n') # Add the files *before* the normal manifest magic is # done. That allows the manifest template to exclude some # files tracked by hg and to include others. self.filelist.extend(files) sdist.get_file_list(self) except OSError, e: raise DistutilsModuleError("could not execute Mercurial: %s" % e)
def get_file_list(self): print("Chosen packaging option: " + name) self.distribution.data_files = data_files _sdist.get_file_list(self)
def run(self): sdist = self.get_finalized_command('sdist') sdist.filelist = distutils.filelist.FileList() sdist.check_metadata() sdist.get_file_list(no_pdf=True) source_files = sdist.filelist.files license_dir = self.distribution.source_dir if not license_dir: license_dir = '.' license_text = {} log.info("reading licenses from %r:", license_dir) for license_file in os.listdir(license_dir): license_path = os.path.join(license_dir, license_file) if (license_file.startswith("LICENSE-") and license_file.endswith(".txt") and os.path.isfile(license_path)): license_text[license_file[8:-4]] = \ open(license_path, 'r').readlines(); log.info(" %r", license_file) def printheader(out, license, prefix): for l in license_text[license]: out.write(prefix) out.write(l) re_start = re.compile( r"^(?P<prefix>.*)\@(?P<license>[^@]+)_HEADER_START\@") re_end = re.compile(r"\@(?P<license>[^@]+)_HEADER_END\@") log.info("updating licenses in files:") for f in source_files: if not os.path.isfile(f): continue in_header = False matched = False in_file = open(f, 'r') out_file = open(f + ".fixed-license", 'w') for l in in_file: m = re_start.search(l) if m and m.group('license') in license_text: # Matched start of hreader section for a license we know in_header = True matched = True out_file.write(l) printheader(out_file, m.group('license'), m.group('prefix')) continue m = re_end.search(l) if m: # Matched end of header section in_header = False out_file.write(l) continue if in_header: # Throw away old header continue out_file.write(l) in_file.close() out_file.close() if matched: # We replaced some stuff os.rename(f, f + ".bak") os.rename(f + ".fixed-license", f) log.info(" %r - updated", f) else: os.unlink(f + ".fixed-license") log.info(" %r - unchanged", f)
def get_file_list(self): _sdist.get_file_list(self) for f in find_files('.', self.debian): self.filelist.append(f)
def get_file_list(self): print "Chosen packaging option: " + name self.distribution.data_files = data_files _sdist.get_file_list(self)