cleanup of list_all and delete_all

This commit is contained in:
phixxy 2026-03-05 01:07:55 -08:00
parent 5673fe0337
commit 8f7d484559

View file

@ -11,10 +11,8 @@ def make_dir(d):
os.mkdir(d)
def delete_all(d):
if not os.path.exists(d):
print("Skratch path doesn't exist")
else:
list_all(d)
fc = list_all(d)
if fc:
x = input("Delete the above files? y/N ")
if x.lower() == 'y':
for file in os.listdir(d):
@ -26,11 +24,14 @@ def delete_all(d):
def list_all(d):
if not os.path.exists(d):
print("Skratch path doesn't exist")
elif os.listdir(d) == []:
return 0
files = os.listdir(d)
if files == []:
print("No skratch files exist")
else:
for file in os.listdir(d):
for file in files:
print(file)
return len(files)
def get_editor(use_v):
v = os.getenv("VISUAL")