[kernel] r11127 - people/waldi/dkt/lib/dkt/itemconfig
Bastian Blank
waldi at alioth.debian.org
Wed Apr 23 08:11:11 UTC 2008
Author: waldi
Date: Wed Apr 23 08:11:10 2008
New Revision: 11127
Log:
* lib/dkt/itemconfig/interfaces.py: Add IItemModulesConfig.
* lib/dkt/itemconfig/modules.py, lib/dkt/itemconfig/package.py: Add.
Added:
people/waldi/dkt/lib/dkt/itemconfig/modules.py
people/waldi/dkt/lib/dkt/itemconfig/package.py
Modified:
people/waldi/dkt/lib/dkt/itemconfig/interfaces.py
Modified: people/waldi/dkt/lib/dkt/itemconfig/interfaces.py
==============================================================================
--- people/waldi/dkt/lib/dkt/itemconfig/interfaces.py (original)
+++ people/waldi/dkt/lib/dkt/itemconfig/interfaces.py Wed Apr 23 08:11:10 2008
@@ -8,6 +8,9 @@
version = Attribute("")
features = Attribute("")
+class IItemModulesConfig(Interface):
+ abi = Attribute("")
+
class IItemPackageConfig(Interface):
name = Attribute("")
version = Attribute("")
Added: people/waldi/dkt/lib/dkt/itemconfig/modules.py
==============================================================================
--- (empty file)
+++ people/waldi/dkt/lib/dkt/itemconfig/modules.py Wed Apr 23 08:11:10 2008
@@ -0,0 +1,27 @@
+from __future__ import absolute_import
+
+from . import interfaces
+from dkt.config.interfaces import IConfig
+from dkt.interface import implements
+from dkt.interface.adapter import registry
+
+class ItemModulesConfig(object):
+ implements(interfaces.IItemModulesConfig)
+
+ @classmethod
+ def _factory(cls, context):
+ if 'package' in context:
+ return cls(context)
+
+ def __init__(self, context):
+ self.context = context
+
+ @property
+ def name(self):
+ return self.context.get('package', 'name')
+
+ @property
+ def version(self):
+ return self.context.get('package', 'version')
+
+registry.register([IConfig], interfaces.IItemModulesConfig, '', ItemModulesConfig._factory)
Added: people/waldi/dkt/lib/dkt/itemconfig/package.py
==============================================================================
--- (empty file)
+++ people/waldi/dkt/lib/dkt/itemconfig/package.py Wed Apr 23 08:11:10 2008
@@ -0,0 +1,27 @@
+from __future__ import absolute_import
+
+from . import interfaces
+from dkt.config.interfaces import IConfig
+from dkt.interface import implements
+from dkt.interface.adapter import registry
+
+class ItemPackageConfig(object):
+ implements(interfaces.IItemPackageConfig)
+
+ @classmethod
+ def _factory(cls, context):
+ if 'package' in context:
+ return cls(context)
+
+ def __init__(self, context):
+ self.context = context
+
+ @property
+ def name(self):
+ return self.context.get('package', 'name')
+
+ @property
+ def version(self):
+ return self.context.get('package', 'version')
+
+registry.register([IConfig], interfaces.IItemPackagConfig, '', ItemPackageConfig._factory)
More information about the Kernel-svn-changes
mailing list