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)
|
os.mkdir(d)
|
||||||
|
|
||||||
def delete_all(d):
|
def delete_all(d):
|
||||||
fc = list_all(d)
|
files = list_all(d)
|
||||||
if fc:
|
if files:
|
||||||
x = input("Delete the above files? y/N ")
|
x = input("Delete the above files? y/N ")
|
||||||
if x.lower() == 'y':
|
if x.lower() == 'y':
|
||||||
for file in os.listdir(d):
|
for file in files:
|
||||||
f = os.path.join(d,file)
|
f = os.path.join(d,file)
|
||||||
os.remove(f)
|
os.remove(f)
|
||||||
print(f"removing: {f}")
|
print(f"removing: {f}")
|
||||||
|
|
@ -31,7 +31,7 @@ def list_all(d):
|
||||||
else:
|
else:
|
||||||
for file in files:
|
for file in files:
|
||||||
print(file)
|
print(file)
|
||||||
return len(files)
|
return files
|
||||||
|
|
||||||
def get_editor(use_v):
|
def get_editor(use_v):
|
||||||
v = os.getenv("VISUAL")
|
v = os.getenv("VISUAL")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue