diff options
-rw-r--r-- | Pipfile | 5 | ||||
-rw-r--r-- | Pipfile.lock | 9 | ||||
-rw-r--r-- | pydis_site/utils/resources.py | 21 |
3 files changed, 18 insertions, 17 deletions
@@ -4,7 +4,7 @@ url = "https://pypi.org/simple" verify_ssl = true [dev-packages] -flake8 = "*" +flake8 = "~=3.7.7" flake8-bandit = "==1.0.2" flake8-bugbear = "~=19.3.0" flake8-import-order = "~=0.18.1" @@ -14,7 +14,8 @@ mccabe = "~=0.6.1" pep8-naming = "~=0.8.2" coverage = "~=4.5.3" unittest-xml-reporting = "~=2.5.1" -flake8-docstrings = "*" +flake8-docstrings = "~=1.3.0" +pydocstyle = "==3.0.0" [packages] django = "~=2.2" diff --git a/Pipfile.lock b/Pipfile.lock index 1da50999..b40b06c1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "a7e8ef5026516c05a7a24abc75904ff8608a429e1714bb01f6420d5f0a91a8cd" + "sha256": "2f1eaa80a71489a59f71001ad4af39e8e570f8d7ebca33b475d2c530811ad084" }, "pipfile-spec": 6, "requires": { @@ -404,9 +404,12 @@ }, "pydocstyle": { "hashes": [ - "sha256:58c421dd605eec0bce65df8b8e5371bb7ae421582cdf0ba8d9435ac5b0ffc36a" + "sha256:2258f9b0df68b97bf3a6c29003edc5238ff8879f1efb6f1999988d934e432bd8", + "sha256:5741c85e408f9e0ddf873611085e819b809fca90b619f5fd7f34bd4959da3dd4", + "sha256:ed79d4ec5e92655eccc21eb0c6cf512e69512b4a97d215ace46d17e4990f2039" ], - "version": "==4.0.0" + "index": "pypi", + "version": "==3.0.0" }, "pyflakes": { "hashes": [ 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 |