summaryrefslogtreecommitdiffstats
path: root/base/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'base/util.py')
-rw-r--r--base/util.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/base/util.py b/base/util.py
index e192b94..5f71534 100644
--- a/base/util.py
+++ b/base/util.py
@@ -85,6 +85,10 @@ def copytree(src, dst):
cpthree(src, dst)
return dst
+def remove_all(i, l):
+ while i in l:
+ l.remove(i)
+
def one(l, f):
for x in l:
if f(x):
@@ -105,4 +109,4 @@ def flatten(l):
return acc
__all__ = ['pwd', 'copy', 'with_sudo', 'with_su', 'symlink', 'move',
- 'log_file', 'one']
+ 'log_file', 'one', 'remove_all', 'flatten']