[kernel] r10330 - in people/waldi/dkt/lib/dkt/hooks: . modules

Bastian Blank waldi at alioth.debian.org
Thu Jan 31 11:35:50 UTC 2008


Author: waldi
Date: Thu Jan 31 11:35:50 2008
New Revision: 10330

Log:
lib/dkt/hooks: Update.


Modified:
   people/waldi/dkt/lib/dkt/hooks/interfaces.py
   people/waldi/dkt/lib/dkt/hooks/load.py
   people/waldi/dkt/lib/dkt/hooks/modules/config_boot_backward.py

Modified: people/waldi/dkt/lib/dkt/hooks/interfaces.py
==============================================================================
--- people/waldi/dkt/lib/dkt/hooks/interfaces.py	(original)
+++ people/waldi/dkt/lib/dkt/hooks/interfaces.py	Thu Jan 31 11:35:50 2008
@@ -1,5 +1,5 @@
 from dkt.interface import Interface, implements
-from . import runner
+import runner
 
 class IHook(Interface):
     pass
@@ -13,8 +13,8 @@
 class IHookRunFirst(IHook):
     pass
 
-class IImagePrepare(IHookRunAllArg):
-    def image_prepare(list):
+class IImageConfig(IHookRunAll):
+    def image_config(config):
         pass
 
 class IImageTask(IHookRunAll):

Modified: people/waldi/dkt/lib/dkt/hooks/load.py
==============================================================================
--- people/waldi/dkt/lib/dkt/hooks/load.py	(original)
+++ people/waldi/dkt/lib/dkt/hooks/load.py	Thu Jan 31 11:35:50 2008
@@ -1,4 +1,3 @@
-from __future__ import absolute_import
 import imp, os, sys
 
 def load(prefix, path):

Modified: people/waldi/dkt/lib/dkt/hooks/modules/config_boot_backward.py
==============================================================================
--- people/waldi/dkt/lib/dkt/hooks/modules/config_boot_backward.py	(original)
+++ people/waldi/dkt/lib/dkt/hooks/modules/config_boot_backward.py	Thu Jan 31 11:35:50 2008
@@ -1,13 +1,11 @@
-from __future__ import absolute_import
-
 from dkt.config.base import Config
 from dkt.hooks import default_registry, interfaces, register
 from dkt.interface import implements
 
 class Hook(object):
-    def _check_config(self, new, list, version, image, initrd):
-        for l in list:
-            if image == list.file:
+    def _check_config(self, configs, version, image, initrd):
+        for l in configs.itervalues():
+            if image == l.file:
                 return
         c = {
             'image':
@@ -21,8 +19,7 @@
         }
         if initrd is not None:
             c['initramfs'] = {'file': initrd}
-        n = Config(c)
-        new.append(n)
+        configs.add('boot-backward-' + version, Config(c))
 
     def _get_files(self):
         import os
@@ -57,12 +54,9 @@
 
         return versions
 
-    def image_prepare(self, list):
+    def image_config(self, configs):
         versions = self._get_versions()
-        new = []
         for version, (image, initrd) in versions.iteritems():
-            self._check_config(new, list, version, image, initrd)
-        list.extend(new)
-        return list
+            self._check_config(configs, version, image, initrd)
 
-register('config-boot-backward', interfaces.IImagePrepare, Hook(), default_registry.PRIORITY_LAST)
+register('config-boot-backward', interfaces.IImageConfig, Hook(), default_registry.PRIORITY_LAST)



More information about the Kernel-svn-changes mailing list