[kernel] r10335 - in people/waldi/dkt/lib/dkt: hooks/modules imageconfig systemconfig

Bastian Blank waldi at alioth.debian.org
Thu Jan 31 12:00:49 UTC 2008


Author: waldi
Date: Thu Jan 31 12:00:49 2008
New Revision: 10335

Log:
* lib/dkt/hooks/modules/config_boot_backward.py: Remove unused import.
* lib/dkt/imageconfig/list.py, lib/dkt/systemconfig/defaults.py: Add.


Added:
   people/waldi/dkt/lib/dkt/imageconfig/list.py
   people/waldi/dkt/lib/dkt/systemconfig/defaults.py
Modified:
   people/waldi/dkt/lib/dkt/hooks/modules/config_boot_backward.py

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 12:00:49 2008
@@ -1,6 +1,5 @@
 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, configs, version, image, initrd):

Added: people/waldi/dkt/lib/dkt/imageconfig/list.py
==============================================================================
--- (empty file)
+++ people/waldi/dkt/lib/dkt/imageconfig/list.py	Thu Jan 31 12:00:49 2008
@@ -0,0 +1,26 @@
+import os
+
+from dkt.config.file import Config
+from dkt.imageconfig.base import ImageBaseConfig
+
+class ImageConfigList(dict):
+    def add(self, name, value):
+        config = ImageBaseConfig._factory(value)
+        if config is None:
+            raise ValueError
+        self[name] = config
+
+    def read_dir(self, dir):
+        for root, dirs, files in os.walk(dir):
+            for f in files:
+                self.read_file(os.path.join(root, f), f)
+
+    def read_file(self, filename, name):
+        config = Config(file(filename))
+        config = ImageBaseConfig._factory(config)
+        if config is not None:
+            self[name] = config
+        else:
+            # XXX
+            pass
+

Added: people/waldi/dkt/lib/dkt/systemconfig/defaults.py
==============================================================================
--- (empty file)
+++ people/waldi/dkt/lib/dkt/systemconfig/defaults.py	Thu Jan 31 12:00:49 2008
@@ -0,0 +1,2 @@
+CONFIG_FILE = "/etc/dkt/dkt.conf"
+IMAGECONFIG_DIRS = ["/usr/local/share/dkt/images", "/usr/share/dkt/images"]



More information about the Kernel-svn-changes mailing list