From: "Matt Turner" <mattst88@gentoo.org> To: gentoo-commits@lists.gentoo.org Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/, doc/, catalyst/base/ Date: Tue, 1 Feb 2022 18:33:17 +0000 (UTC) [thread overview] Message-ID: <1643584634.67e93e47d30280594c109b8153a83f0a19c027e5.mattst88@gentoo> (raw) commit: 67e93e47d30280594c109b8153a83f0a19c027e5 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> AuthorDate: Sun Jan 30 20:22:43 2022 +0000 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> CommitDate: Sun Jan 30 23:17:14 2022 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=67e93e47 catalyst: Switch to tomli The Python community is coalescing around tomli, and tomli is likely to be integrated into the standard library per PEP680. Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> catalyst/base/stagebase.py | 6 +++--- catalyst/main.py | 5 +++-- doc/make_subarch_table_guidexml.py | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 4a1b4eb6..de1e30ef 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,7 +10,7 @@ from pathlib import Path import fasteners import libmount -import toml +import tomli from snakeoil import fileutils from snakeoil.osutils import pjoin @@ -123,8 +123,8 @@ class StageBase(TargetBase, ClearBase, GenBase): log.debug("\tTrying %s", x) name = x[:-len('.toml')] - with open(arch_dir + x) as file: - arch_config = toml.load(file) + with open(arch_dir + x, 'rb') as file: + arch_config = tomli.load(file) # Search for a subarchitecture in each arch in the arch_config for arch in [x for x in arch_config if x.startswith(name) and host in arch_config[x]]: diff --git a/catalyst/main.py b/catalyst/main.py index 0de1040f..6e9a2d3e 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -6,7 +6,7 @@ import os import sys import textwrap -import toml +import tomli from DeComp.definitions import (COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS, CONTENTS_DEFINITIONS) @@ -35,7 +35,8 @@ def parse_config(config_files): for config_file in config_files: log.notice('Loading configuration file: %s', config_file) try: - config = toml.load(config_file) + with open(config_file, 'rb') as f: + config = tomli.load(f) for key in config: if key not in valid_config_file_values: log.critical("Unknown option '%s' in config file %s", diff --git a/doc/make_subarch_table_guidexml.py b/doc/make_subarch_table_guidexml.py index 67ed3ccc..3c03f90c 100755 --- a/doc/make_subarch_table_guidexml.py +++ b/doc/make_subarch_table_guidexml.py @@ -5,7 +5,7 @@ import pathlib import sys import textwrap -import toml +import tomli def write_guidexml(arch_to_subarch): @@ -40,7 +40,8 @@ def main(_argv): p = pathlib.Path('arch') for file in p.glob('*.toml'): - data = toml.load(file) + with file.open('rb') as f: + data = tomli.load(f) for arch in [x for x in data if x != 'setarch']: arch_to_subarch.update({arch: list(data[arch].keys())})
WARNING: multiple messages have this Message-ID (diff)
From: "Matt Turner" <mattst88@gentoo.org> To: gentoo-commits@lists.gentoo.org Subject: [gentoo-commits] proj/catalyst:wip/mattst88 commit in: catalyst/, doc/, catalyst/base/ Date: Sun, 30 Jan 2022 23:17:23 +0000 (UTC) [thread overview] Message-ID: <1643584634.67e93e47d30280594c109b8153a83f0a19c027e5.mattst88@gentoo> (raw) Message-ID: <20220130231723.xXEtOyALJ8ijEZmyst1kzhoEtt5tMK0YIiTI58CrUmQ@z> (raw) commit: 67e93e47d30280594c109b8153a83f0a19c027e5 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> AuthorDate: Sun Jan 30 20:22:43 2022 +0000 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> CommitDate: Sun Jan 30 23:17:14 2022 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=67e93e47 catalyst: Switch to tomli The Python community is coalescing around tomli, and tomli is likely to be integrated into the standard library per PEP680. Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> catalyst/base/stagebase.py | 6 +++--- catalyst/main.py | 5 +++-- doc/make_subarch_table_guidexml.py | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 4a1b4eb6..de1e30ef 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,7 +10,7 @@ from pathlib import Path import fasteners import libmount -import toml +import tomli from snakeoil import fileutils from snakeoil.osutils import pjoin @@ -123,8 +123,8 @@ class StageBase(TargetBase, ClearBase, GenBase): log.debug("\tTrying %s", x) name = x[:-len('.toml')] - with open(arch_dir + x) as file: - arch_config = toml.load(file) + with open(arch_dir + x, 'rb') as file: + arch_config = tomli.load(file) # Search for a subarchitecture in each arch in the arch_config for arch in [x for x in arch_config if x.startswith(name) and host in arch_config[x]]: diff --git a/catalyst/main.py b/catalyst/main.py index 0de1040f..6e9a2d3e 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -6,7 +6,7 @@ import os import sys import textwrap -import toml +import tomli from DeComp.definitions import (COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS, CONTENTS_DEFINITIONS) @@ -35,7 +35,8 @@ def parse_config(config_files): for config_file in config_files: log.notice('Loading configuration file: %s', config_file) try: - config = toml.load(config_file) + with open(config_file, 'rb') as f: + config = tomli.load(f) for key in config: if key not in valid_config_file_values: log.critical("Unknown option '%s' in config file %s", diff --git a/doc/make_subarch_table_guidexml.py b/doc/make_subarch_table_guidexml.py index 67ed3ccc..3c03f90c 100755 --- a/doc/make_subarch_table_guidexml.py +++ b/doc/make_subarch_table_guidexml.py @@ -5,7 +5,7 @@ import pathlib import sys import textwrap -import toml +import tomli def write_guidexml(arch_to_subarch): @@ -40,7 +40,8 @@ def main(_argv): p = pathlib.Path('arch') for file in p.glob('*.toml'): - data = toml.load(file) + with file.open('rb') as f: + data = tomli.load(f) for arch in [x for x in data if x != 'setarch']: arch_to_subarch.update({arch: list(data[arch].keys())})
next reply other threads:[~2022-02-01 18:33 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-02-01 18:33 Matt Turner [this message] 2022-01-30 23:17 ` [gentoo-commits] proj/catalyst:wip/mattst88 commit in: catalyst/, doc/, catalyst/base/ Matt Turner
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1643584634.67e93e47d30280594c109b8153a83f0a19c027e5.mattst88@gentoo \ --to=mattst88@gentoo.org \ --cc=gentoo-commits@lists.gentoo.org \ --cc=gentoo-dev@lists.gentoo.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox