From b3b515f593f71af5d396372413db47abbda7435f Mon Sep 17 00:00:00 2001 From: Erik Hahn Date: Thu, 30 Jul 2009 20:21:48 +0200 Subject: [PATCH] Add newpath function --- ordnung.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ordnung.py b/ordnung.py index 859f3b0..c82c317 100644 --- a/ordnung.py +++ b/ordnung.py @@ -12,6 +12,16 @@ def issupportedfile(name): return True return False +def newpath(file, target, pattern): + # Create the tokens dictionary + try: + tokens = tag(file) + except: + return None + if tokens["album artist"] == None: + tokens["album artist"] = tokens["artist"] + tokens["base"] = target + def main(): ## Handle arguments (TODO) # This will probably the default later one, at least until I @@ -23,12 +33,6 @@ def main(): for filepath in basepath.walkfiles(): if issupportedfile(filepath): print filepath - try: - audio = tag(filepath) - except: #TODO - print "Error reading tags" - else: - print audio["title"] if __name__ == "__main__": main() -- 2.11.4.GIT