diff options
| author | Cody Logan <cody@lokken.dev> | 2023-11-16 12:29:36 -0800 |
|---|---|---|
| committer | Cody Logan <cody@lokken.dev> | 2023-11-16 12:29:36 -0800 |
| commit | 06dfda7b5430bfc895a39defad50f184d41281f1 (patch) | |
| tree | 858948a451305a117678f6047f1a6b9ab714f72b /src | |
| parent | dbb8dd8a3ba3e5bd65edae2aded253975708dc13 (diff) | |
| download | wikiget-06dfda7b5430bfc895a39defad50f184d41281f1.tar.gz wikiget-06dfda7b5430bfc895a39defad50f184d41281f1.zip | |
Additional type checking import blocks
Diffstat (limited to 'src')
| -rw-r--r-- | src/wikiget/client.py | 10 | ||||
| -rw-r--r-- | src/wikiget/file.py | 8 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/wikiget/client.py b/src/wikiget/client.py index 2fc4a6c..64c14d9 100644 --- a/src/wikiget/client.py +++ b/src/wikiget/client.py @@ -15,15 +15,21 @@ # You should have received a copy of the GNU General Public License # along with Wikiget. If not, see <https://www.gnu.org/licenses/>. +from __future__ import annotations + import logging -from argparse import Namespace +from typing import TYPE_CHECKING from mwclient import APIError, InvalidResponse, LoginError, Site -from mwclient.image import Image from requests import ConnectionError, HTTPError import wikiget +if TYPE_CHECKING: + from argparse import Namespace + + from mwclient.image import Image + logger = logging.getLogger(__name__) diff --git a/src/wikiget/file.py b/src/wikiget/file.py index a362aff..6fc03a1 100644 --- a/src/wikiget/file.py +++ b/src/wikiget/file.py @@ -15,12 +15,16 @@ # You should have received a copy of the GNU General Public License # along with Wikiget. If not, see <https://www.gnu.org/licenses/>. -from pathlib import Path +from __future__ import annotations -from mwclient.image import Image +from pathlib import Path +from typing import TYPE_CHECKING from wikiget import DEFAULT_SITE +if TYPE_CHECKING: + from mwclient.image import Image + class File: """A file object.""" |
