debug mode
This commit is contained in:
parent
d9971f3c66
commit
d0f11023f4
1 changed files with 8 additions and 5 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue