diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-12-19 02:12:57 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-12-19 02:12:57 +0000 |
| commit | ed40f6f85c9c07c3c1224ae20601082c0309a631 (patch) | |
| tree | 4082515a3e85107bd4a278b6613857b58da1770f /lib/python/Plugins/Extensions/MediaScanner/plugin.py | |
| parent | b3658b04216ed3974047b4c4ec885ee0161d9267 (diff) | |
| download | enigma2-ed40f6f85c9c07c3c1224ae20601082c0309a631.tar.gz enigma2-ed40f6f85c9c07c3c1224ae20601082c0309a631.zip | |
some python import cleanups
lesser swig overhead
Diffstat (limited to 'lib/python/Plugins/Extensions/MediaScanner/plugin.py')
| -rw-r--r-- | lib/python/Plugins/Extensions/MediaScanner/plugin.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/python/Plugins/Extensions/MediaScanner/plugin.py b/lib/python/Plugins/Extensions/MediaScanner/plugin.py index 5fc35ee1..71f2f1c8 100644 --- a/lib/python/Plugins/Extensions/MediaScanner/plugin.py +++ b/lib/python/Plugins/Extensions/MediaScanner/plugin.py @@ -1,6 +1,6 @@ from Plugins.Plugin import PluginDescriptor -import os -import string +from os import path as os_path, walk as os_walk +from string import lower def getExtension(file): p = file.rfind('.') @@ -9,7 +9,7 @@ def getExtension(file): else: ext = file[p+1:] - return string.lower(ext) + return lower(ext) class Scanner: def __init__(self, name, extensions = [], paths_to_scan = [], description = "", openfnc = None): @@ -128,12 +128,12 @@ def ScanDevice(mountpoint): # now scan the paths for p in paths_to_scan: - path = os.path.join(mountpoint, p.path) + path = os_path.join(mountpoint, p.path) - for root, dirs, files in os.walk(path): + for root, dirs, files in os_walk(path): for f in files: ext = getExtension(f) - pathname = os.path.join(root, f) + pathname = os_path.join(root, f) for s in scanner: s.handleFile(res, pathname, ext) |
