The Last Modify. All Things Will Be Suspended Forever...
[sudos/utilities.git] / cleaner.py
blob4f3523738b4f1466b95b101cae3393ae1e806159
1 # Clean all vim temp files *~,and ~.swp
3 import stat,os
5 def looplast (lists):
6 mode = os.stat(lists)[0]
8 if stat.S_ISREG(mode):
9 if lists[-1]=='~' or lists[-4:-1]=='.sw':
10 os.remove(lists)
11 print lists
12 else :
13 sublist = os.listdir(lists)
14 for subf in sublist:
15 subf = lists+'\\'+subf
16 looplast(subf)
18 dirs = os.getcwd()
20 looplast(dirs)
22 input()