From 7c52896ad9278ffde8b67cd42ed8f512d0ce91a1 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozachuk Date: Tue, 11 Jul 2023 14:16:59 +0200 Subject: [PATCH] Switch from PyTOML to tomlkit. --- fjerkroa_bot/discord_bot.py | 4 ++-- pyproject.toml | 3 +-- requirements.txt | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/fjerkroa_bot/discord_bot.py b/fjerkroa_bot/discord_bot.py index 99f067e..2bc92cc 100644 --- a/fjerkroa_bot/discord_bot.py +++ b/fjerkroa_bot/discord_bot.py @@ -1,6 +1,6 @@ import sys import argparse -import toml +import tomlkit import discord import logging from discord import Message, TextChannel, DMChannel @@ -76,7 +76,7 @@ class FjerkroaBot(commands.Bot): @classmethod def load_config(self, config_file: str = "config.toml"): with open(config_file, encoding='utf-8') as file: - return toml.load(file) + return tomlkit.load(file) def channel_by_name(self, channel_name: Optional[str], diff --git a/pyproject.toml b/pyproject.toml index c960e3e..c557c31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,5 +43,4 @@ pytest = "*" setuptools = "*" wheel = "*" watchdog = "*" -toml = "*" -types-toml = "*" +tomlkit = "*" diff --git a/requirements.txt b/requirements.txt index 64854f0..fca7fb2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,6 +8,5 @@ pytest setuptools wheel watchdog -toml -types-toml +tomlkit multiline