From d0f11023f428adb306451f20d6a288a3670d2e42 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 25 Mar 2008 19:19:54 +0000 Subject: [PATCH] debug mode --- oxdbarchive/model.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/oxdbarchive/model.py b/oxdbarchive/model.py index 3fe5238..81d3302 100644 --- a/oxdbarchive/model.py +++ b/oxdbarchive/model.py @@ -27,6 +27,9 @@ from subtitles import * from extract import * import midentify +def debug(string): + #print string + return hub = PackageHub('oxdbarchive') __connection__ = hub @@ -531,7 +534,7 @@ class ArchiveFile(SQLObject): if not movie_file or not exists(movie_file): return if exists(mini_movie_file) and not force: - print "clip exists, skipping extraction", mini_movie_file + debug("clip exists, skipping extraction %s" % mini_movie_file) return self.extracted = False oxdb_makedir(dirname(mini_movie_file)) @@ -543,7 +546,7 @@ class ArchiveFile(SQLObject): options += ' "%s"' % movie_file.replace('"', '\\"') options += ' -o "%s"' % mini_movie_file cmd = "mencoder %s >/dev/null 2>&1" % options - #print cmd.encode('utf-8') + debug(cmd.encode('utf-8')) r = os.system(cmd.encode('utf-8')) if r == 0: self.extracted = True @@ -563,12 +566,12 @@ class ArchiveFile(SQLObject): return if not (self.extracted and exists(self.mini_movie_file)): - print "mini movie missing, skipping", self.path + debug("mini movie missing, skipping %s" % self.path) return t = self.timelineFile if exists(t): - print "skipping, ", self.path + debug("timeline exists , %s" % self.path) return oxdb_makedir(dirname(t)) @@ -594,7 +597,7 @@ class ArchiveFile(SQLObject): if not subtitle.absolutePath or not exists(subtitle.absolutePath): return if not subtitle.absolutePath.endswith('.srt'): - print "this is not a subtitle", subtitle.absolutePath + debug("this is not a subtitle %s" % subtitle.absolutePath) return movieFile.srt = loadSrt(subtitle.absolutePath)