From f36d82397a7ea841d1532eee2002d9e645f1f2bb Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 28 Nov 2020 02:27:02 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fix=20scroll=20class=20initializ?= =?UTF-8?q?ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- royalnet/scrolls/__init__.py | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 02ab6d91..b5e23867 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "royalnet" -version = "6.0.0a13" +version = "6.0.0a14" description = "A multipurpose bot and web framework" authors = ["Stefano Pigozzi "] license = "AGPL-3.0-or-later" diff --git a/royalnet/scrolls/__init__.py b/royalnet/scrolls/__init__.py index 7bde8437..0ef9e958 100644 --- a/royalnet/scrolls/__init__.py +++ b/royalnet/scrolls/__init__.py @@ -55,14 +55,6 @@ class Scroll: config = json.load(file) return cls(namespace, config) - loaders = { - ".json": from_json, - ".toml": from_toml, - } - """ - An extension to deserialization function map. - """ - @classmethod def from_file(cls, namespace: str, file_path: os.PathLike, require_file: bool = False) -> Scroll: """ @@ -134,4 +126,13 @@ class Scroll: return self._get_from_config(item) +Scroll.loaders = { + ".json": Scroll.from_json, + ".toml": Scroll.from_toml, +} +""" +An extension to deserialization function map. +""" + + __all__ = ("Scroll",)