aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site
diff options
context:
space:
mode:
Diffstat (limited to 'pydis_site')
-rw-r--r--pydis_site/utils/resources.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/pydis_site/utils/resources.py b/pydis_site/utils/resources.py
index 875c0dc9..ab0df9d7 100644
--- a/pydis_site/utils/resources.py
+++ b/pydis_site/utils/resources.py
@@ -1,22 +1,22 @@
from __future__ import annotations
-import yaml
-import typing
import glob
+import typing
from dataclasses import dataclass
+import yaml
+
@dataclass
class URL:
+ """A class representing a link to a resource"""
icon: str
title: str
url: str
class Resource:
- """
- A class representing a resource on the resource page
- """
+ """A class representing a resource on the resource page"""
description: str
name: str
payment: str
@@ -24,6 +24,7 @@ class Resource:
urls: typing.List[URL]
def __repr__(self):
+ """Return a representation of the resource"""
return f"<Resource name={self.name}>"
@classmethod
@@ -43,14 +44,13 @@ class Resource:
class Category:
- """
- A class representing a resource on the resources page
- """
+ """A class representing a resource on the resources page"""
resources: typing.List[Resource]
name: str
description: str
def __repr__(self):
+ """Return a representation of the category"""
return f"<Category name={self.name}>"
@classmethod
@@ -77,10 +77,7 @@ class Category:
def load_categories(order: typing.List[str]) -> typing.List[Category]:
- """
- Load the categories specified in the order list and return them
- as a list.
- """
+ """Load the categories specified in the order list and return them"""
categories = []
for cat in order:
direc = "pydis_site/apps/home/resources/" + cat