From 05457af0d73ff3a820c0b465e6607fc5832a6e74 Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Fri, 20 Oct 2023 16:23:28 -0700 Subject: Reorganize File class --- src/wikiget/file.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/wikiget/file.py') diff --git a/src/wikiget/file.py b/src/wikiget/file.py index c1b9ae6..b890e63 100644 --- a/src/wikiget/file.py +++ b/src/wikiget/file.py @@ -15,9 +15,13 @@ # You should have received a copy of the GNU General Public License # along with Wikiget. If not, see . +from mwclient.image import Image + +from wikiget import DEFAULT_SITE + class File: - def __init__(self, name, dest=""): + def __init__(self, name: str, dest: str = "", site: str = "") -> None: """ Initializes a new file with the specified name and an optional destination name. @@ -26,8 +30,10 @@ class File: :param dest: destination of the file, if different from the name; if not specified, defaults to the name :type dest: str, optional + :param site: name of the site hosting the file; if not specified, defaults to + the global default site """ - self.object = None - self.site = None + self.image: Image = None self.name = name self.dest = dest if dest else name + self.site = site if site else DEFAULT_SITE -- cgit v1.2.3