aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Tools
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2009-07-30 12:07:43 +0200
committerghost <andreas.monzner@multimedia-labs.de>2009-07-30 12:07:43 +0200
commit7a33f3edf33fcd2291957c05d883d80af3f058ce (patch)
treeab983ab5747c3928587a593366528873932aa3de /lib/python/Tools
parenta6e5bb5ef14da6f61cf974d0f9d35a2a1bbbc51f (diff)
parented817937df0a68c0b222a4e48fdf24984d87c2fb (diff)
downloadenigma2-7a33f3edf33fcd2291957c05d883d80af3f058ce.tar.gz
enigma2-7a33f3edf33fcd2291957c05d883d80af3f058ce.zip
Merge branch 'master' of git.opendreambox.org:/git/enigma2
Diffstat (limited to 'lib/python/Tools')
-rwxr-xr-xlib/python/Tools/Directories.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/python/Tools/Directories.py b/lib/python/Tools/Directories.py
index f9394978..aaa2a9da 100755
--- a/lib/python/Tools/Directories.py
+++ b/lib/python/Tools/Directories.py
@@ -262,3 +262,14 @@ def copytree(src, dst, symlinks=False):
utime(dst, (st.st_atime, st.st_mtime))
except:
print "copy stats for", src, "failed!"
+
+def getSize(path, pattern=".*"):
+ path_size = 0
+ if os_path.isdir(path):
+ files = crawlDirectory(path, pattern)
+ for file in files:
+ filepath = os_path.join(file[0], file[1])
+ path_size += os_path.getsize(filepath)
+ elif os_path.isfile(path):
+ path_size = os_path.getsize(path)
+ return path_size