[kernel] r10706 - people/waldi/dkt/lib/dkt/imageconfig

Bastian Blank waldi at alioth.debian.org
Wed Mar 5 12:05:51 UTC 2008


Author: waldi
Date: Wed Mar  5 12:05:50 2008
New Revision: 10706

Log:
lib/dkt/imageconfig: Cleanup.


Modified:
   people/waldi/dkt/lib/dkt/imageconfig/base.py
   people/waldi/dkt/lib/dkt/imageconfig/interfaces.py
   people/waldi/dkt/lib/dkt/imageconfig/linux_initramfs.py

Modified: people/waldi/dkt/lib/dkt/imageconfig/base.py
==============================================================================
--- people/waldi/dkt/lib/dkt/imageconfig/base.py	(original)
+++ people/waldi/dkt/lib/dkt/imageconfig/base.py	Wed Mar  5 12:05:50 2008
@@ -2,7 +2,7 @@
 
 #from . import interfaces
 import interfaces
-from dkt.config import interfaces as config_interfaces
+from dkt.config.interfaces import IConfig
 from dkt.interface import implements
 from dkt.interface.adapter import registry
 
@@ -11,9 +11,8 @@
 
     @classmethod
     def _factory(cls, context):
-        if 'image' not in context:
-            return None
-        return cls(context)
+        if 'image' in context:
+            return cls(context)
 
     def __init__(self, context):
         self.context = context
@@ -27,6 +26,10 @@
         return self.context.get('image', 'type')
 
     @property
+    def subtype(self):
+        return self.context.get('image', 'subtype', None)
+
+    @property
     def file(self):
         return self.context.get('image', 'file')
 
@@ -36,13 +39,10 @@
 
     @property
     def features(self):
-        return self.context.get('image', 'features').split()
+        return self.context.get('image', 'features', '').split()
 
     @property
     def package(self):
         return self.context.get('image', 'package', None)
 
-    def get_config(self):
-        return config_interfaces.IConfig(self.context)
-
-registry.register([config_interfaces.IConfig], interfaces.IImageBaseConfig, '', ImageBaseConfig._factory)
+registry.register([IConfig], interfaces.IImageBaseConfig, '', ImageBaseConfig._factory)

Modified: people/waldi/dkt/lib/dkt/imageconfig/interfaces.py
==============================================================================
--- people/waldi/dkt/lib/dkt/imageconfig/interfaces.py	(original)
+++ people/waldi/dkt/lib/dkt/imageconfig/interfaces.py	Wed Mar  5 12:05:50 2008
@@ -2,15 +2,13 @@
 
 class IImageBaseConfig(Interface):
     type = Attribute("")
+    subtype = Attribute("")
     architecture = Attribute("")
     file = Attribute("")
     version = Attribute("")
     features = Attribute("")
     package = Attribute("")
 
-    def get_config():
-        pass
-
 class IImageLinuxInitramfsConfig(Interface):
     file = Attribute("")
 

Modified: people/waldi/dkt/lib/dkt/imageconfig/linux_initramfs.py
==============================================================================
--- people/waldi/dkt/lib/dkt/imageconfig/linux_initramfs.py	(original)
+++ people/waldi/dkt/lib/dkt/imageconfig/linux_initramfs.py	Wed Mar  5 12:05:50 2008
@@ -11,9 +11,8 @@
 
     @classmethod
     def _factory(cls, context):
-        if 'image' not in context or context.get('image', 'type', None) != 'linux':
-            return None
-        return cls(context)
+        if 'image' in context and context.get('image', 'type', None) == 'linux':
+            return cls(context)
 
     def __init__(self, context):
         self.context = context



More information about the Kernel-svn-changes mailing list