diff options
| author | Dennis Fink | 2021-05-07 08:46:50 +0200 |
|---|---|---|
| committer | Dennis Fink | 2021-05-07 08:46:50 +0200 |
| commit | 41bda1ad45270151b4a04f78a4d63b789f878284 (patch) | |
| tree | d6dec3684e058db4de3c97f6039f8ef92d94d11a | |
| parent | 59af84161d88c672075c60255233271f9c042c07 (diff) | |
| download | patternutils-41bda1ad45270151b4a04f78a4d63b789f878284.tar.gz patternutils-41bda1ad45270151b4a04f78a4d63b789f878284.zip | |
Use ternary expression for forcing option in tln and tmv
Diffstat (limited to '')
| -rw-r--r-- | patternutils/commands/tln.py | 5 | ||||
| -rw-r--r-- | 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: |
