diff options
| author | Cody Logan <cody@lokken.dev> | 2023-10-20 16:23:28 -0700 |
|---|---|---|
| committer | Cody Logan <cody@lokken.dev> | 2023-10-20 16:23:28 -0700 |
| commit | 05457af0d73ff3a820c0b465e6607fc5832a6e74 (patch) | |
| tree | cc1a6e13d2a651c4048c5092c4f7891bb982c676 /src/wikiget/file.py | |
| parent | 59b97c7bef21cf68935b68fa7de6fd67653e21af (diff) | |
| download | wikiget-05457af0d73ff3a820c0b465e6607fc5832a6e74.tar.gz wikiget-05457af0d73ff3a820c0b465e6607fc5832a6e74.zip | |
Reorganize File class
Diffstat (limited to 'src/wikiget/file.py')
| -rw-r--r-- | src/wikiget/file.py | 12 |
1 files changed, 9 insertions, 3 deletions
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 <https://www.gnu.org/licenses/>. +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 |
