diff options
Diffstat (limited to 'cli/new')
-rw-r--r-- | cli/new/command.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/new/command.py b/cli/new/command.py index dae0be7..17b686c 100644 --- a/cli/new/command.py +++ b/cli/new/command.py @@ -32,7 +32,7 @@ def run(books_library, book_source=None): metadata_path = f'{output_dir}/metadata.toml' cover_path = f'{output_dir}/cover.webp' - if not book_source is None: + if book_source is not None: ext = format.extension(book_source) book_path = f'{output_dir}/book{ext}' book_source_dir = os.path.dirname(os.path.realpath(book_source)) @@ -55,7 +55,7 @@ def run(books_library, book_source=None): # Ask for confirmation print(f'About to create:\n\n- {metadata_path}\n- {cover_path}') - if not book_source is None: + if book_source is not None: print(f'- {book_path}') print(f'\nAnd moving:\n\n {book_source},\n -> {book_source_new}.') print() @@ -68,7 +68,7 @@ def run(books_library, book_source=None): download_cover(cover_url, cover_path) with open(metadata_path, 'w') as f: f.write(metadata) - if not book_path is None: + if book_source is not None: shutil.copyfile(book_source, book_path) if format.extension(book_source) in ['mobi', 'azw3']: os.rename(book_source, book_source_new) |