From adf5c89e80ca8320dc441332fbaff9879ed1e3f8 Mon Sep 17 00:00:00 2001 From: farhan Date: Tue, 8 Oct 2024 14:18:58 +0500 Subject: [PATCH] chore: Minor improvement --- done/done.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/done/done.py b/done/done.py index 1441da2..8a3307e 100644 --- a/done/done.py +++ b/done/done.py @@ -5,7 +5,6 @@ import uuid -import importlib.resources from web_fragments.fragment import Fragment from xblock.core import XBlock from xblock.fields import Boolean, DateTime, Float, Scope, String @@ -25,9 +24,8 @@ def _(text): def resource_string(path): - """Handy helper for getting resources from our kit.""" - data = importlib.resources.files(__package__).joinpath(path) - return data.read_text(encoding="utf8") + """Retrieves the contents of a file as a string from the specified path.""" + return resource_loader.load_unicode(path) @XBlock.needs('i18n')