diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-08-07 18:33:30 -0700 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-08-07 18:33:30 -0700 |
| commit | 236fd1d9f2009083fbbfce7190c27fbf1d7c88b8 (patch) | |
| tree | 6077ff15b4b770b4b292aaa14d9cbfff1ba82fae /frontend/im/OLD/clearthedirectories | |
| parent | c89619f1b1f908d0f330c468866cea669ce8bf6c (diff) | |
getting ready
Diffstat (limited to 'frontend/im/OLD/clearthedirectories')
| -rwxr-xr-x | frontend/im/OLD/clearthedirectories | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/frontend/im/OLD/clearthedirectories b/frontend/im/OLD/clearthedirectories new file mode 100755 index 0000000..6d5b2a7 --- /dev/null +++ b/frontend/im/OLD/clearthedirectories @@ -0,0 +1,51 @@ +#!/usr/bin/python2.7 + +import sys +import os +import time + +f = open("directories",'r') +lines = f.readlines() +f.close() +newlines = [] +for line in lines: + if "\n" in line: + jerry = line.replace("\n","") + if len(jerry) == 2: + newlines.append(jerry) +dirs = newlines +print dirs +for dir in dirs: + print dir + if len(dir) == 2: + delete = False + os.system("ls "+dir+"/ >> contents") + f = open("contents","r") + thecontents = f.readlines() + f.close() + print thecontents + os.system("rm contents") + tempbool = False + tempbool2 = False + if len(thecontents) != 0: + for x in thecontents: + if ".jpg" in x: + tempbool = True +# if len(thedirs)>40: +# tempbool2 = True + if tempbool == True:# and tempbool2 == True: + print "deleting contents.." + print "moving to directory '"+dir+"'" + if len(thecontents)>0: + x = input("bout to do some deleting 1=yes 0=no") + if x == 1: + print "ok deleting "+dir+"/*" + try: + os.system("rm "+dir+"/*") + except: + continue + else: + sys.exit() + else: + print "nothing there" + continue |
