[SCM] live-studio branch, master, updated. be51da814fb12d25dce46a7f078a46f5c89bd777

Chris Lamb lamby at debian.org
Fri Jul 30 02:52:35 UTC 2010


The following commit has been merged in the master branch:
commit afad8f2fa0d1f2f3d5a8b70d441e1668fe8856ff
Author: Chris Lamb <lamby at debian.org>
Date:   Thu Jul 29 14:22:20 2010 -0400

    Manage a temporary directory too.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>

diff --git a/live_studio/queue/management/commands/queue_runner.py b/live_studio/queue/management/commands/queue_runner.py
index d988ee5..35414cd 100644
--- a/live_studio/queue/management/commands/queue_runner.py
+++ b/live_studio/queue/management/commands/queue_runner.py
@@ -1,5 +1,7 @@
 import time
+import shutil
 import datetime
+import tempfile
 import traceback
 
 from django.core.management.base import NoArgsCommand
@@ -20,18 +22,21 @@ class Command(NoArgsCommand):
 
                 update(started=datetime.datetime.utcnow())
 
+                tempdir = tempfile.mkdtemp(prefix='live-studio_')
+
                 try:
-                    self.handle_entry(entry)
+                    self.handle_entry(entry, tempdir)
                     update(success=True)
                 except:
                     traceback.print_exc()
                     continue
                 finally:
                     update(finished=datetime.datetime.utcnow())
+                    shutil.rmtree(tempdir)
 
             except IndexError:
                 time.sleep(2)
 
-    def handle_entry(self, entry):
+    def handle_entry(self, entry, tempdir):
         # Process 'entry' here
         pass

-- 
live-studio



More information about the debian-live-changes mailing list