Skip to content
Snippets Groups Projects
Commit e2a6236e authored by Recolic's avatar Recolic :house_with_garden:
Browse files

add remove orphan prog

parent 6d0be758
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,8 @@ if os.name == 'nt': ...@@ -15,6 +15,8 @@ if os.name == 'nt':
######################################################################### #########################################################################
import os, shutil import os, shutil
if os.name == 'nt':
from send2trash import send2trash
def main(): def main():
print("DEBUG: workdir=", os.getcwd()) print("DEBUG: workdir=", os.getcwd())
...@@ -24,7 +26,7 @@ def main(): ...@@ -24,7 +26,7 @@ def main():
filesl = [f.lower() for f in os.listdir('.') if os.path.isfile(f)] filesl = [f.lower() for f in os.listdir('.') if os.path.isfile(f)]
for f in files: for f in files:
if is_drw(f): if is_drw(f):
print("CHECKING ", f) #print("CHECKING ", f)
ext_len = len('.slddrw') ext_len = len('.slddrw')
expecting1 = f[:-ext_len] + '.sldprt' expecting1 = f[:-ext_len] + '.sldprt'
...@@ -35,11 +37,13 @@ def main(): ...@@ -35,11 +37,13 @@ def main():
else: else:
# delete this file # delete this file
print("DELETE ", f) print("DELETE ", f)
os.remove(f) if os.name == 'nt':
send2trash(f)
else:
os.remove(f)
main() main()
input("按回车键退出")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment