Skip to content

Commit

Permalink
Remove extra white spaces
Browse files Browse the repository at this point in the history
Signed-off-by: anton.denishchenko <anton.denishchenko@evernym.com>
  • Loading branch information
adenishchenko committed Feb 14, 2021
1 parent f8ccba1 commit 263c38c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/remove_ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@

def warn(ledger_name, directories_path):
print('The following directories will be deleted:')

for path in directories_path:
print(str(path))

print('Deleting a ledger is an irrevocable operation.\nProceed only if you know the consequences.')
answer = input('Do you want to delete ledger ' + ledger_name + '?\n Press [y/N]')

if answer.lower() == 'yes' or answer.lower() == 'y':
return True

return False


Expand All @@ -29,15 +29,15 @@ def remove(ledger_name):

for path in Path(config_helper.ledger_data_dir).rglob(ledger_name + "_*"):
directories_path.append(path)

if not len(directories_path):
print('Ledger doesn`t exist: ' + ledger_name)

elif warn(ledger_name, directories_path):
for path in directories_path:
shutil.rmtree(str(path))
print('Ledger removed successfully!')

else:
print('Can`t delete built in ledger: ' + ledger_name)

Expand Down

0 comments on commit 263c38c

Please sign in to comment.