From 41bda1ad45270151b4a04f78a4d63b789f878284 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Fri, 7 May 2021 08:46:50 +0200 Subject: Use ternary expression for forcing option in tln and tmv --- patternutils/commands/tln.py | 5 +---- patternutils/commands/tmv.py | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/patternutils/commands/tln.py b/patternutils/commands/tln.py index b0476b2..6d49e42 100644 --- a/patternutils/commands/tln.py +++ b/patternutils/commands/tln.py @@ -145,10 +145,7 @@ def tln( if has_existing and abort_on_path_exist: raise SystemExit - if force: - files_to_move = new_filenames.items() - else: - files_to_move = non_existing.items() + files_to_move = new_filenames.items() if force else non_existing.items() for old, new in files_to_move: if verbose or interactive: diff --git a/patternutils/commands/tmv.py b/patternutils/commands/tmv.py index a82b8f7..3b7f5e3 100644 --- a/patternutils/commands/tmv.py +++ b/patternutils/commands/tmv.py @@ -143,10 +143,7 @@ def tmv( if has_existing and abort_on_path_exist: raise SystemExit - if force: - files_to_move = new_filenames.items() - else: - files_to_move = non_existing.items() + files_to_move = new_filenames.items() if force else non_existing.items() for old, new in files_to_move: if verbose or interactive: -- cgit v1.3.1