diff options
author | 2019-07-07 00:18:46 +0100 | |
---|---|---|
committer | 2019-07-07 00:18:46 +0100 | |
commit | b467d74ed86e109e7b4fac62634219b7b7955414 (patch) | |
tree | dd3fbe1a65770b464095462945a52a48bc56bc3e /pydis_site/utils | |
parent | unpin flake8 & flake8 docstrings to see if it fixes linting (diff) |
pin pycodestyle to 3.0.0 and fix linting errors
Diffstat (limited to 'pydis_site/utils')
-rw-r--r-- | pydis_site/utils/resources.py | 21 |
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 |