diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-02-03 22:00:17 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-02-03 22:00:17 +0000 |
| commit | 4c7c01f0ab441ab881d94fca25005561debf6773 (patch) | |
| tree | 5b8ec015bf16c7e36b509ea08ccbefa3593adde1 | |
| parent | Fix cropping bug that results in rotated pages (diff) | |
| download | paper2remarkable-4c7c01f0ab441ab881d94fca25005561debf6773.tar.gz paper2remarkable-4c7c01f0ab441ab881d94fca25005561debf6773.zip | |
Reorder provider check for local file
The is_url function can in some cases consider a path to a file
as a valid url, which defeats the purpose. So I'm setting it back
to first checking for a local file, then checking for a url
| -rw-r--r-- | paper2remarkable/ui.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/paper2remarkable/ui.py b/paper2remarkable/ui.py index 032bf99..4160f12 100644 --- a/paper2remarkable/ui.py +++ b/paper2remarkable/ui.py @@ -99,13 +99,13 @@ def main(): args = parse_args() cookiejar = None - if is_url(args.input): + if LocalFile.validate(args.input): + # input is a local file + provider = LocalFile + elif is_url(args.input): # input is a url url, cookiejar = follow_redirects(args.input) provider = next((p for p in providers if p.validate(url)), None) - elif LocalFile.validate(args.input): - # input is a local file - provider = LocalFile else: # not a proper URL or non-existent file exception( |
