repo.or.cz
/
sudos
/
utilities.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
The Last Modify. All Things Will Be Suspended Forever...
[sudos/utilities.git]
/
cleaner.py
blob
4f3523738b4f1466b95b101cae3393ae1e806159
1
# Clean all vim temp files *~,and ~.swp
2
3
import
stat
,
os
4
5
def
looplast
(
lists
):
6
mode
=
os
.
stat
(
lists
)[
0
]
7
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
)
17
18
dirs
=
os
.
getcwd
()
19
20
looplast
(
dirs
)
21
22
input
()