Author: reinhard
Date: 2010-12-03 11:30:08 -0600 (Fri, 03 Dec 2010)
New Revision: 10267

Modified:
   trunk/gnue-common/
   trunk/gnue-common/src/base/tree.py
Log:
Some improvements to documentation and sample code.



Property changes on: trunk/gnue-common
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2010-12-03 00:28:11.546999931 +0100
committer: Reinhard Müller <[email protected]>
properties: 
        branch-nick: common

   + timestamp: 2010-12-03 00:59:15.023999929 +0100
committer: Reinhard Müller <[email protected]>
properties: 
        branch-nick: common

Name: bzr:file-ids
   - src/apps/GDebug.py 
1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fapps%2FGDebug.py
src/apps/i18n.py        
5...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fapps%2Fi18n.py
src/datasources/ConnectionTriggerObj.py 
5...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fdatasources%2FConnectionTriggerObj.py
src/datasources/GConnections.py 
1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fdatasources%2FGConnections.py
src/datasources/GDataSource.py  
1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fdatasources%2FGDataSource.py
src/datasources/GLoginHandler.py        
1...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fdatasources%2FGLoginHandler.py
src/logic/NamespaceCore.py      
3...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Flogic%2FNamespaceCore.py
src/logic/adapters/Base.py      
5...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Flogic%2Fadapters%2FBase.py
src/logic/adapters/python.py    
5...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Flogic%2Fadapters%2Fpython.py
src/logic/language.py   
5...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Flogic%2Flanguage.py

   + src/base/tree.py   
9...@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fbase%2Ftree.py

Name: bzr:revision-id:v4
   - 3116 [email protected]
3117 [email protected]
3118 [email protected]
3119 [email protected]
3120 [email protected]
3121 [email protected]
3122 [email protected]
3123 [email protected]
3124 [email protected]
3125 [email protected]
3126 [email protected]
3127 [email protected]
3128 [email protected]
3129 [email protected]
3130 [email protected]
3131 [email protected]
3132 [email protected]
3133 [email protected]
3134 [email protected]
3135 [email protected]
3136 [email protected]
3137 [email protected]
3138 [email protected]
3139 [email protected]
3140 [email protected]
3141 [email protected]
3142 [email protected]
3143 [email protected]
3144 [email protected]
3145 [email protected]

   + 3116 [email protected]
3117 [email protected]
3118 [email protected]
3119 [email protected]
3120 [email protected]
3121 [email protected]
3122 [email protected]
3123 [email protected]
3124 [email protected]
3125 [email protected]
3126 [email protected]
3127 [email protected]
3128 [email protected]
3129 [email protected]
3130 [email protected]
3131 [email protected]
3132 [email protected]
3133 [email protected]
3134 [email protected]
3135 [email protected]
3136 [email protected]
3137 [email protected]
3138 [email protected]
3139 [email protected]
3140 [email protected]
3141 [email protected]
3142 [email protected]
3143 [email protected]
3144 [email protected]
3145 [email protected]
3146 [email protected]

Name: bzr:text-parents
   - src/apps/GDebug.py 
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/apps/i18n.py        
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/datasources/ConnectionTriggerObj.py 
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9986
src/datasources/GConnections.py 
[email protected]
src/datasources/GDataSource.py  
[email protected]
src/datasources/GLoginHandler.py        
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/logic/NamespaceCore.py      
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/logic/adapters/Base.py      
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/logic/adapters/python.py    
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954
src/logic/language.py   
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:9954

   + src/base/tree.py   
svn-v3-single1-dHJ1bmsvZ251ZS1jb21tb24.:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:10118


Modified: trunk/gnue-common/src/base/tree.py
===================================================================
--- trunk/gnue-common/src/base/tree.py  2010-12-03 17:29:44 UTC (rev 10266)
+++ trunk/gnue-common/src/base/tree.py  2010-12-03 17:30:08 UTC (rev 10267)
@@ -711,20 +711,24 @@
     default value these attributes will have::
 
         class SpecialNode(AttribNode):
-            _node_attribs_ = NamedNode._node_attribs_.copy()
-            _node_attribs_['color'] = {
-                'type': str,
-                'allowed_values': ['white', 'blue', 'red', 'green'],
-                'required': False,
-                'default': 'white',
-                'label': u_("Background Color"),
-                'description': u_("Color on the screen")}
-            _node_attribs_['speed'] = {
-                'type': int,
-                'required': True,
-                'default': 0,
-                'label': u_("Speed"),
-                'description': u_("Speed in km per hour")}
+            _node_attribs_ = AttribNode._node_attribs_.copy()
+            _node_attribs_.update(
+                color = dict(
+                    type = str,
+                    default = 'white',
+                    allowed_values = ['white', 'blue', 'red', 'green'],
+                    required = False,
+                    label = u_("Background Color"),
+                    description = u_("Color on the screen")
+                )
+                speed = dict(
+                    type = int,
+                    default = 0,
+                    required = True,
+                    label = u_("Speed"),
+                    description = u_("Speed in km per hour")
+                )
+            )
 
     The items in the dictionaries are as follows:
 
@@ -784,11 +788,13 @@
     # Class variables
     # -------------------------------------------------------------------------
 
-    _node_attribs_ = {
-            'name': {
-                    'type': str,
-                    'label': u_("Name"),
-                    'description': u_("Name of this element")}}
+    _node_attribs_ = dict(
+        name = dict(
+            type = str,
+            label = u_("Name"),
+            description = u_("Name of this element")
+        )
+    )
 
 
     # -------------------------------------------------------------------------
@@ -1384,9 +1390,15 @@
         def _change_supervisor_(self, value):
             print "Hey, %s's supervisor has changed to %s" % (self, value)
     Member._node_attribs_ = AttribNode._node_attribs_.copy()
-    Member._node_attribs_.update({
-        'rank': {'type': str, 'required': True},
-        'supervisor': {'type': Member}})
+    Member._node_attribs_.update(
+        rank = dict(
+            type = str,
+            required = True
+        ),
+        supervisor = dict(
+            type = Member
+        )
+    )
     class Crew(AttribNode):
         _allowed_children_ = {Member: {}}
         _node_dicts_ = [Member]


_______________________________________________
commit-gnue mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/commit-gnue

Reply via email to