changeset 17:427a94428f04

have a different class for stable updates
author jhammel
date Fri, 26 Oct 2012 15:04:47 +0000
parents 31898fb3b7d9
children 6ffbad8cc31f
files dogdish/dispatcher.py
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dogdish/dispatcher.py	Fri Oct 26 14:46:28 2012 +0000
+++ b/dogdish/dispatcher.py	Fri Oct 26 15:04:47 2012 +0000
@@ -77,6 +77,10 @@
                 self._hash = hashlib.sha512(f.read()).hexdigest()
         return self._hash
 
+class UpdateStable(Update):
+    prefix = 'b2g_stable_update_'
+
+
 ### request handlers
 
 class Handler(object):
@@ -151,7 +155,8 @@
 
 
     ### class level variables
-    defaults = {'directory': here}
+    defaults = {'directory': here, 
+                'update_class': Update}
 
     def __init__(self, **kw):
 
@@ -190,14 +195,14 @@
         """
 
         # check for new updates
-        contents = Update.updates(self.directory)
+        contents = self.update_class.updates(self.directory)
         new = contents.difference(self.updates.keys())
         if not new:
             # directory contents unchanged from cached values
             return False
 
         for update in new:
-            self.updates[update] = Update(self.directory, update)
+            self.updates[update] = self.update_class(self.directory, update)
             if self.current_update:
                 if self.updates[update].stamp > self.current_update.stamp:
                     self.current_update = self.updates[update]