CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
saveopts.py22 linesDownload Raw Back to command
1from setuptools.command.setopt import edit_config, option_base2 3 4class saveopts(option_base):5    """Save command-line options to a file"""6 7    description = "save supplied options to setup.cfg or other config file"8 9    def run(self) -> None:10        dist = self.distribution11        settings: dict[str, dict[str, str]] = {}12 13        for cmd in dist.command_options:14            if cmd == 'saveopts':15                continue  # don't save our own options!16 17            for opt, (src, val) in dist.get_option_dict(cmd).items():18                if src == "command line":19                    settings.setdefault(cmd, {})[opt] = val20 21        edit_config(self.filename, settings, self.dry_run)22 
Aluode/PerceptionLabPortable · CoolFace