[Checkins] SVN: Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/ better way for the name of the lib

Christian Klinger cklinger at novareto.de
Wed Oct 14 10:25:25 EDT 2009


Log message for revision 105066:
  better  way for the name of the lib

Changed:
  U   Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/components.py
  U   Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/meta.py

-=-
Modified: Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/components.py
===================================================================
--- Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/components.py	2009-10-14 13:59:46 UTC (rev 105065)
+++ Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/components.py	2009-10-14 14:25:25 UTC (rev 105066)
@@ -13,7 +13,11 @@
 class Library(DirectoryResource):
     libs = []    
 
+    @property
+    def name(self):
+        return grok.name.bind().get(self) 
 
+
 @grok.adapter(Library)
 @grok.implementer(ILibraryUrl)
 def library_url(library):

Modified: Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/meta.py
===================================================================
--- Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/meta.py	2009-10-14 13:59:46 UTC (rev 105065)
+++ Sandbox/cklinger/megrok.resource/trunk/src/megrok/resource/meta.py	2009-10-14 14:25:25 UTC (rev 105066)
@@ -19,7 +19,8 @@
 
 
     def execute(self, class_, config, name, inclusion, layer, permission, **kw):
-        setattr(class_, 'name', name)
+        #setattr(class_, 'name', name)
+        class_.name = name
         for name, file, depends, bottom in inclusion:
             RI = ResourceInclusion(class_, file, depends=depends, bottom=bottom)
             setattr(class_, name, RI)



More information about the checkins mailing list