Voice et bot modif
This commit is contained in:
parent
189d56026b
commit
7333a22bcd
10774 changed files with 634644 additions and 933308 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -61,7 +61,7 @@ class alias(option_base):
|
|||
alias = self.args[0]
|
||||
command = ' '.join(map(shquote, self.args[1:]))
|
||||
|
||||
edit_config(self.filename, {'aliases': {alias: command}}, self.dry_run)
|
||||
edit_config(self.filename, {'aliases': {alias: command}})
|
||||
|
||||
|
||||
def format_alias(name, aliases):
|
||||
|
|
|
|||
|
|
@ -159,7 +159,6 @@ class bdist_egg(Command):
|
|||
for dirname in INSTALL_DIRECTORY_ATTRS:
|
||||
kw.setdefault(dirname, self.bdist_dir)
|
||||
kw.setdefault('skip_build', self.skip_build)
|
||||
kw.setdefault('dry_run', self.dry_run)
|
||||
cmd = self.reinitialize_command(cmdname, **kw)
|
||||
self.run_command(cmdname)
|
||||
return cmd
|
||||
|
|
@ -186,8 +185,7 @@ class bdist_egg(Command):
|
|||
pyfile = os.path.join(self.bdist_dir, strip_module(filename) + '.py')
|
||||
self.stubs.append(pyfile)
|
||||
log.info("creating stub loader for %s", ext_name)
|
||||
if not self.dry_run:
|
||||
write_stub(os.path.basename(ext_name), pyfile)
|
||||
write_stub(os.path.basename(ext_name), pyfile)
|
||||
to_compile.append(pyfile)
|
||||
ext_outputs[p] = ext_name.replace(os.sep, '/')
|
||||
|
||||
|
|
@ -209,15 +207,13 @@ class bdist_egg(Command):
|
|||
native_libs = os.path.join(egg_info, "native_libs.txt")
|
||||
if all_outputs:
|
||||
log.info("writing %s", native_libs)
|
||||
if not self.dry_run:
|
||||
ensure_directory(native_libs)
|
||||
with open(native_libs, 'wt', encoding="utf-8") as libs_file:
|
||||
libs_file.write('\n'.join(all_outputs))
|
||||
libs_file.write('\n')
|
||||
ensure_directory(native_libs)
|
||||
with open(native_libs, 'wt', encoding="utf-8") as libs_file:
|
||||
libs_file.write('\n'.join(all_outputs))
|
||||
libs_file.write('\n')
|
||||
elif os.path.isfile(native_libs):
|
||||
log.info("removing %s", native_libs)
|
||||
if not self.dry_run:
|
||||
os.unlink(native_libs)
|
||||
os.unlink(native_libs)
|
||||
|
||||
write_safety_flag(os.path.join(archive_root, 'EGG-INFO'), self.zip_safe())
|
||||
|
||||
|
|
@ -235,11 +231,10 @@ class bdist_egg(Command):
|
|||
self.egg_output,
|
||||
archive_root,
|
||||
verbose=self.verbose,
|
||||
dry_run=self.dry_run, # type: ignore[arg-type] # Is an actual boolean in vendored _distutils
|
||||
mode=self.gen_header(),
|
||||
)
|
||||
if not self.keep_temp:
|
||||
remove_tree(self.bdist_dir, dry_run=self.dry_run)
|
||||
remove_tree(self.bdist_dir)
|
||||
|
||||
# Add to 'Distribution.dist_files' so that the "upload" command works
|
||||
getattr(self.distribution, 'dist_files', []).append((
|
||||
|
|
@ -446,7 +441,6 @@ def make_zipfile(
|
|||
zip_filename: StrPathT,
|
||||
base_dir,
|
||||
verbose: bool = False,
|
||||
dry_run: bool = False,
|
||||
compress=True,
|
||||
mode: _ZipFileMode = 'w',
|
||||
) -> StrPathT:
|
||||
|
|
@ -458,7 +452,7 @@ def make_zipfile(
|
|||
"""
|
||||
import zipfile
|
||||
|
||||
mkpath(os.path.dirname(zip_filename), dry_run=dry_run) # type: ignore[arg-type] # python/mypy#18075
|
||||
mkpath(os.path.dirname(zip_filename)) # type: ignore[arg-type] # python/mypy#18075
|
||||
log.info("creating '%s' and adding '%s' to it", zip_filename, base_dir)
|
||||
|
||||
def visit(z, dirname, names):
|
||||
|
|
@ -466,17 +460,12 @@ def make_zipfile(
|
|||
path = os.path.normpath(os.path.join(dirname, name))
|
||||
if os.path.isfile(path):
|
||||
p = path[len(base_dir) + 1 :]
|
||||
if not dry_run:
|
||||
z.write(path, p)
|
||||
z.write(path, p)
|
||||
log.debug("adding '%s'", p)
|
||||
|
||||
compression = zipfile.ZIP_DEFLATED if compress else zipfile.ZIP_STORED
|
||||
if not dry_run:
|
||||
z = zipfile.ZipFile(zip_filename, mode, compression=compression)
|
||||
for dirname, dirs, files in sorted_walk(base_dir):
|
||||
visit(z, dirname, files)
|
||||
z.close()
|
||||
else:
|
||||
for dirname, dirs, files in sorted_walk(base_dir):
|
||||
visit(None, dirname, files)
|
||||
z = zipfile.ZipFile(zip_filename, mode, compression=compression)
|
||||
for dirname, dirs, files in sorted_walk(base_dir):
|
||||
visit(z, dirname, files)
|
||||
z.close()
|
||||
return zip_filename
|
||||
|
|
|
|||
|
|
@ -449,8 +449,7 @@ class bdist_wheel(Command):
|
|||
|
||||
if not self.keep_temp:
|
||||
log.info(f"removing {self.bdist_dir}")
|
||||
if not self.dry_run:
|
||||
_shutil.rmtree(self.bdist_dir)
|
||||
_shutil.rmtree(self.bdist_dir)
|
||||
|
||||
def write_wheelfile(
|
||||
self, wheelfile_base: str, generator: str = f"setuptools ({__version__})"
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ class build_ext(_build_ext):
|
|||
|
||||
def setup_shlib_compiler(self) -> None:
|
||||
compiler = self.shlib_compiler = new_compiler(
|
||||
compiler=self.compiler, dry_run=self.dry_run, force=self.force
|
||||
compiler=self.compiler, force=self.force
|
||||
)
|
||||
_customize_compiler_for_shlib(compiler)
|
||||
|
||||
|
|
@ -351,54 +351,52 @@ class build_ext(_build_ext):
|
|||
log.info("writing stub loader for %s to %s", ext._full_name, stub_file)
|
||||
if compile and os.path.exists(stub_file):
|
||||
raise BaseError(stub_file + " already exists! Please delete.")
|
||||
if not self.dry_run:
|
||||
with open(stub_file, 'w', encoding="utf-8") as f:
|
||||
content = (
|
||||
textwrap
|
||||
.dedent(f"""
|
||||
def __bootstrap__():
|
||||
global __bootstrap__, __file__, __loader__
|
||||
import sys, os, importlib.resources as irs, importlib.util
|
||||
#rtld import dl
|
||||
with irs.files(__name__).joinpath(
|
||||
{os.path.basename(ext._file_name)!r}) as __file__:
|
||||
del __bootstrap__
|
||||
if '__loader__' in globals():
|
||||
del __loader__
|
||||
#rtld old_flags = sys.getdlopenflags()
|
||||
old_dir = os.getcwd()
|
||||
try:
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
#rtld sys.setdlopenflags(dl.RTLD_NOW)
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
__name__, __file__)
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(mod)
|
||||
finally:
|
||||
#rtld sys.setdlopenflags(old_flags)
|
||||
os.chdir(old_dir)
|
||||
__bootstrap__()
|
||||
""")
|
||||
.lstrip()
|
||||
.replace('#rtld', '#rtld' * (not have_rtld))
|
||||
)
|
||||
f.write(content)
|
||||
with open(stub_file, 'w', encoding="utf-8") as f:
|
||||
content = (
|
||||
textwrap
|
||||
.dedent(f"""
|
||||
def __bootstrap__():
|
||||
global __bootstrap__, __file__, __loader__
|
||||
import sys, os, importlib.resources as irs, importlib.util
|
||||
#rtld import dl
|
||||
with irs.files(__name__).joinpath(
|
||||
{os.path.basename(ext._file_name)!r}) as __file__:
|
||||
del __bootstrap__
|
||||
if '__loader__' in globals():
|
||||
del __loader__
|
||||
#rtld old_flags = sys.getdlopenflags()
|
||||
old_dir = os.getcwd()
|
||||
try:
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
#rtld sys.setdlopenflags(dl.RTLD_NOW)
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
__name__, __file__)
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(mod)
|
||||
finally:
|
||||
#rtld sys.setdlopenflags(old_flags)
|
||||
os.chdir(old_dir)
|
||||
__bootstrap__()
|
||||
""")
|
||||
.lstrip()
|
||||
.replace('#rtld', '#rtld' * (not have_rtld))
|
||||
)
|
||||
f.write(content)
|
||||
if compile:
|
||||
self._compile_and_remove_stub(stub_file)
|
||||
|
||||
def _compile_and_remove_stub(self, stub_file: str):
|
||||
from distutils.util import byte_compile
|
||||
|
||||
byte_compile([stub_file], optimize=0, force=True, dry_run=self.dry_run)
|
||||
byte_compile([stub_file], optimize=0, force=True)
|
||||
optimize = self.get_finalized_command('install_lib').optimize
|
||||
if optimize > 0:
|
||||
byte_compile(
|
||||
[stub_file],
|
||||
optimize=optimize,
|
||||
force=True,
|
||||
dry_run=self.dry_run,
|
||||
)
|
||||
if os.path.exists(stub_file) and not self.dry_run:
|
||||
if os.path.exists(stub_file):
|
||||
os.unlink(stub_file)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -801,7 +801,6 @@ class _NamespaceInstaller(namespaces.Installer):
|
|||
self.installation_dir = installation_dir
|
||||
self.editable_name = editable_name
|
||||
self.outputs: list[str] = []
|
||||
self.dry_run = False
|
||||
|
||||
def _get_nspkg_file(self):
|
||||
"""Installation target."""
|
||||
|
|
|
|||
|
|
@ -280,16 +280,14 @@ class egg_info(InfoCommon, Command):
|
|||
"""
|
||||
log.info("writing %s to %s", what, filename)
|
||||
data = data.encode("utf-8")
|
||||
if not self.dry_run:
|
||||
f = open(filename, 'wb')
|
||||
f.write(data)
|
||||
f.close()
|
||||
f = open(filename, 'wb')
|
||||
f.write(data)
|
||||
f.close()
|
||||
|
||||
def delete_file(self, filename) -> None:
|
||||
"""Delete `filename` (if not a dry run) after announcing it"""
|
||||
log.info("deleting %s", filename)
|
||||
if not self.dry_run:
|
||||
os.unlink(filename)
|
||||
os.unlink(filename)
|
||||
|
||||
def run(self) -> None:
|
||||
# Pre-load to avoid iterating over entry-points while an empty .egg-info
|
||||
|
|
@ -650,19 +648,18 @@ def write_file(filename, contents) -> None:
|
|||
|
||||
def write_pkg_info(cmd, basename, filename) -> None:
|
||||
log.info("writing %s", filename)
|
||||
if not cmd.dry_run:
|
||||
metadata = cmd.distribution.metadata
|
||||
metadata.version, oldver = cmd.egg_version, metadata.version
|
||||
metadata.name, oldname = cmd.egg_name, metadata.name
|
||||
metadata = cmd.distribution.metadata
|
||||
metadata.version, oldver = cmd.egg_version, metadata.version
|
||||
metadata.name, oldname = cmd.egg_name, metadata.name
|
||||
|
||||
try:
|
||||
metadata.write_pkg_info(cmd.egg_info)
|
||||
finally:
|
||||
metadata.name, metadata.version = oldname, oldver
|
||||
try:
|
||||
metadata.write_pkg_info(cmd.egg_info)
|
||||
finally:
|
||||
metadata.name, metadata.version = oldname, oldver
|
||||
|
||||
safe = getattr(cmd.distribution, 'zip_safe', None)
|
||||
safe = getattr(cmd.distribution, 'zip_safe', None)
|
||||
|
||||
bdist_egg.write_safety_flag(cmd.egg_info, safe)
|
||||
bdist_egg.write_safety_flag(cmd.egg_info, safe)
|
||||
|
||||
|
||||
def warn_depends_obsolete(cmd, basename, filename) -> None:
|
||||
|
|
|
|||
|
|
@ -31,11 +31,10 @@ class install_egg_info(namespaces.Installer, Command):
|
|||
def run(self) -> None:
|
||||
self.run_command('egg_info')
|
||||
if os.path.isdir(self.target) and not os.path.islink(self.target):
|
||||
dir_util.remove_tree(self.target, dry_run=self.dry_run)
|
||||
dir_util.remove_tree(self.target)
|
||||
elif os.path.exists(self.target):
|
||||
self.execute(os.unlink, (self.target,), "Removing " + self.target)
|
||||
if not self.dry_run:
|
||||
ensure_directory(self.target)
|
||||
ensure_directory(self.target)
|
||||
self.execute(self.copytree, (), f"Copying {self.source} to {self.target}")
|
||||
self.install_namespaces()
|
||||
|
||||
|
|
|
|||
|
|
@ -60,8 +60,7 @@ class install_scripts(orig.install_scripts):
|
|||
|
||||
encoding = None if "b" in mode else "utf-8"
|
||||
mask = current_umask()
|
||||
if not self.dry_run:
|
||||
ensure_directory(target)
|
||||
with open(target, "w" + mode, encoding=encoding) as f:
|
||||
f.write(contents)
|
||||
chmod(target, 0o777 - mask)
|
||||
ensure_directory(target)
|
||||
with open(target, "w" + mode, encoding=encoding) as f:
|
||||
f.write(contents)
|
||||
chmod(target, 0o777 - mask)
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity version="1.0.0.0"
|
||||
processorArchitecture="X86"
|
||||
name="%(name)s"
|
||||
type="win32"/>
|
||||
<!-- Identify the application security requirements. -->
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
||||
|
|
@ -58,8 +58,7 @@ class rotate(Command):
|
|||
files = files[self.keep :]
|
||||
for t, f in files:
|
||||
log.info("Deleting %s", f)
|
||||
if not self.dry_run:
|
||||
if os.path.isdir(f):
|
||||
_shutil.rmtree(f)
|
||||
else:
|
||||
os.unlink(f)
|
||||
if os.path.isdir(f):
|
||||
_shutil.rmtree(f)
|
||||
else:
|
||||
os.unlink(f)
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@ class saveopts(option_base):
|
|||
if src == "command line":
|
||||
settings.setdefault(cmd, {})[opt] = val
|
||||
|
||||
edit_config(self.filename, settings, self.dry_run)
|
||||
edit_config(self.filename, settings)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ def config_file(kind="local"):
|
|||
raise ValueError("config_file() type must be 'local', 'global', or 'user'", kind)
|
||||
|
||||
|
||||
def edit_config(filename, settings, dry_run=False) -> None:
|
||||
def edit_config(filename, settings) -> None:
|
||||
"""Edit a configuration file to include `settings`
|
||||
|
||||
`settings` is a dictionary of dictionaries or ``None`` values, keyed by
|
||||
|
|
@ -64,9 +64,8 @@ def edit_config(filename, settings, dry_run=False) -> None:
|
|||
opts.set(section, option, value)
|
||||
|
||||
log.info("Writing %s", filename)
|
||||
if not dry_run:
|
||||
with open(filename, 'w', encoding="utf-8") as f:
|
||||
opts.write(f)
|
||||
with open(filename, 'w', encoding="utf-8") as f:
|
||||
opts.write(f)
|
||||
|
||||
|
||||
class option_base(Command):
|
||||
|
|
@ -137,5 +136,4 @@ class setopt(option_base):
|
|||
edit_config(
|
||||
self.filename,
|
||||
{self.command: {self.option.replace('-', '_'): self.set_value}},
|
||||
self.dry_run,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue