fixed some nesting in delete_all
This commit is contained in:
parent
8f7d484559
commit
fe069eab7d
1 changed files with 4 additions and 4 deletions
|
|
@ -11,11 +11,11 @@ def make_dir(d):
|
|||
os.mkdir(d)
|
||||
|
||||
def delete_all(d):
|
||||
fc = list_all(d)
|
||||
if fc:
|
||||
files = list_all(d)
|
||||
if files:
|
||||
x = input("Delete the above files? y/N ")
|
||||
if x.lower() == 'y':
|
||||
for file in os.listdir(d):
|
||||
for file in files:
|
||||
f = os.path.join(d,file)
|
||||
os.remove(f)
|
||||
print(f"removing: {f}")
|
||||
|
|
@ -31,7 +31,7 @@ def list_all(d):
|
|||
else:
|
||||
for file in files:
|
||||
print(file)
|
||||
return len(files)
|
||||
return files
|
||||
|
||||
def get_editor(use_v):
|
||||
v = os.getenv("VISUAL")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue