Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

various tweaks for the queue

  • Loading branch information...
commit 09b0d57b1f7d4cd15c7862eede33cc654fb4597b 1 parent 87cfc22
Daniele Procida authored
Showing with 19 additions and 4 deletions.
  1. +4 −1 video/cms_plugins.py
  2. +8 −1 video/models.py
  3. +7 −2 video/tasks.py
5 video/cms_plugins.py
View
@@ -32,6 +32,7 @@ def render(self, context, instance, placeholder):
So, we should make the calculations here optional, and for non-Arkestra implementations do something different
"""
+ print "****"
instance.has_borders = False
# calculate the width of the placeholder
@@ -86,6 +87,7 @@ def render(self, context, instance, placeholder):
videofilepath = version.outputpath()
# does the file exist?
+ print "**"
print "** version", codec_and_size
print "** version status", version.status
if os.path.exists(videofilepath):
@@ -106,7 +108,8 @@ def render(self, context, instance, placeholder):
if getattr(settings, "USE_CELERY_FOR_VIDEO_ENCODING", None):
print "** launching encodevideo()"
- encodevideo.delay(source = instance.video, size = size, codec = codec)
+ version_status = encodevideo.delay(source = instance.video, size = size, codec = codec)
+ print "** got back from encodevideo()", version_status
else:
thread = Thread(target=version.encode, name=videofilepath)
thread.start()
9 video/models.py
View
@@ -87,6 +87,11 @@ def filename(self):
def directory(self):
# e.g. "filer_private/2010/11/23"
+ print ">> self ", self
+ print ">> self.source ", self.source
+ print ">> self.source.file ", self.source.file
+ print ">> str(self.source.file)", str(self.source.file)
+ print ">> os.path.dirname(str(self.source.file))", os.path.dirname(str(self.source.file))
return os.path.dirname(str(self.source.file))
def encode(self):
@@ -139,6 +144,7 @@ def encode(self):
print ">>> saved status"
print "command:", str(command)
exit_status = subprocess.call(command)
+ print exit_status
print ">>> exited from", command
if exit_status == 0: # it's OK, so mark the version OK
self.status = "ready"
@@ -150,7 +156,8 @@ def encode(self):
print ">>> save FAILED", exit_status
# we should never return from here with the status still "encoding" - but that has happened - how?
-
+ return self.status
+
def url(self):
# the url for a particular version
return os.path.join(settings.MEDIA_URL, \
9 video/tasks.py
View
@@ -4,6 +4,11 @@
@task
def encodevideo(source, size, codec):
+ logger = encodevideo.get_logger()
+ logger.info("**********************")
+ print "======== in encodevideo task ========="
version, created = VideoVersion.objects.get_or_create(source = source, size = size, codec = codec)
- version.encode()
- return
+ print "== version, created", version, created
+ version_status = version.encode()
+ print "== version_status", version_status
+ return version_status
Please sign in to comment.
Something went wrong with that request. Please try again.