diff options
| -rw-r--r-- | docs/wikiget.1 | 13 | ||||
| -rw-r--r-- | docs/wikiget.1.md | 11 | ||||
| -rw-r--r-- | src/wikiget/dl.py | 2 | ||||
| -rw-r--r-- | src/wikiget/version.py | 2 | ||||
| -rw-r--r-- | tests/test_dl.py | 3 |
5 files changed, 21 insertions, 10 deletions
diff --git a/docs/wikiget.1 b/docs/wikiget.1 index fa1a33d..0d7bf9b 100644 --- a/docs/wikiget.1 +++ b/docs/wikiget.1 @@ -1,6 +1,6 @@ -.\" Automatically generated by Pandoc 3.1.8 +.\" Automatically generated by Pandoc 3.1.9 .\" -.TH "WIKIGET" "1" "October 5, 2023" "Version 0.5.1" "Wikiget User Manual" +.TH "WIKIGET" "1" "November 16, 2023" "Version 0.8.0" "Wikiget User Manual" .SH NAME wikiget - download files from MediaWiki sites .SH SYNOPSIS @@ -81,6 +81,11 @@ If this flag is set, \f[B]wikiget\f[R] will run in batch download mode Number of parallel downloads to attempt in batch mode. This option has no effect if -\f[B]a\f[R] is not also set. .TP +-\f[B]n\f[R], --\f[B]dry-run\f[R] +Do a dry-run of the download process. +Useful for checking the format of a batch file. +Nothing will actually be downloaded. +.TP -\f[B]v\f[R], --\f[B]verbose\f[R] Print additional information, such as the site used and the full URL of the file. @@ -120,4 +125,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/. .SH AUTHORS -Cody Logan <clpo13@gmail.com>. +Cody Logan \c +.MT cody@lokken.dev +.ME \c. diff --git a/docs/wikiget.1.md b/docs/wikiget.1.md index fd274d5..d537942 100644 --- a/docs/wikiget.1.md +++ b/docs/wikiget.1.md @@ -1,6 +1,6 @@ -% WIKIGET(1) Version 0.5.1 | Wikiget User Manual -% Cody Logan <clpo13@gmail.com> -% October 5, 2023 +% WIKIGET(1) Version 0.8.0 | Wikiget User Manual +% Cody Logan <cody@lokken.dev> +% November 16, 2023 # NAME @@ -72,6 +72,11 @@ the file name or the URL of its description page. : Number of parallel downloads to attempt in batch mode. This option has no effect if \-**a** is not also set. +\-**n**, \-\-**dry-run** + +: Do a dry-run of the download process. Useful for checking the format of a batch file. Nothing will actually be + downloaded. + \-**v**, \-\-**verbose** : Print additional information, such as the site used and the full URL of the file. Additional invocations will diff --git a/src/wikiget/dl.py b/src/wikiget/dl.py index c9b2ed5..9b53d66 100644 --- a/src/wikiget/dl.py +++ b/src/wikiget/dl.py @@ -189,7 +189,7 @@ def download(f: File, args: Namespace) -> int: # prepend the current filename to all log messages adapter = FileLogAdapter(logger, {"filename": filename}) - if file.exists: + if file.imageinfo: # file exists either locally or at a common repository, like Wikimedia Commons file_url = file.imageinfo["url"] file_size = file.imageinfo["size"] diff --git a/src/wikiget/version.py b/src/wikiget/version.py index 479f200..804c60f 100644 --- a/src/wikiget/version.py +++ b/src/wikiget/version.py @@ -15,4 +15,4 @@ # You should have received a copy of the GNU General Public License # along with Wikiget. If not, see <https://www.gnu.org/licenses/>. -__version__ = "0.8.0.dev0" +__version__ = "0.8.0" diff --git a/tests/test_dl.py b/tests/test_dl.py index b0822cf..10f5fd5 100644 --- a/tests/test_dl.py +++ b/tests/test_dl.py @@ -338,7 +338,6 @@ class TestDownload: """ file = File(name="Example.jpg") file.image = Mock() - file.image.exists = True file.image.imageinfo = { "url": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg", "size": 9022, @@ -506,7 +505,7 @@ class TestDownload: self, mock_file: File, caplog: pytest.LogCaptureFixture ) -> None: """Test that a warning message is logged if no file info was returned.""" - mock_file.image.exists = False + mock_file.image.imageinfo = {} args = parse_args(["File:Example.jpg"]) errors = download(mock_file, args) |
