Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /leo/test/test.leo

leo
Discussion topic

Back to topic list

CVS update: /leo/test/test.leo

Author vivainio
Full name Ville M. Vainio
Date 2008-02-04 10:04:19 PST
Message User: vivainio
Date: 2008-02-04 10:04:19-0800
Log:
 added __getattr__ to leoInterfaceResults

File Changes:

Directory: /leo/test/
=====================

File [changed]: test.leo
Url: http://leo.tigris.or​g/source/browse/leo/​test/test.leo?r1=1.5​91&r2=1.592
Delta lines: +20 -5
--------------------
--- test.leo 2008-02-03 04:02:51-0800 1.591
+++ test.leo 2008-02-04 10:04:14-0800 1.592
@@ -3,7 +3,7 @@
 <leo_file>
 <leo_header file_format="2" tnodes="0" max_tnode_index="0" clone_windows="0"/>
 <globals body_outline_ratio="​0.571052631579">
- <global_window_position top="16" left="149" height="950" width="1047"/>
+ <global_window_position top="28" left="343" height="930" width="1047"/>
     <global_log_window_position top="0" left="0" height="0" width="0"/>
 </globals>
 <preferences/>
@@ -288,7 +288,7 @@
 </v>
 <v t="ekr.2008011810004​9"><vh>cair​o</vh></v​>
 </v>
-<v t="ekr.2007031507183​0"><vh>Test​ files (do not delete)</vh>
+<v t="ekr.20070315071830" a="E"><vh>Test files (do not delete)</vh>
 <v t="ekr.2007022710471​3"><vh>@thi​n leoBridgeTest.py<​/vh></v>
 <v t="ekr.2007062615391​2"><vh>@thi​n leoDynamicTest.py​</vh></v>
 </v>
@@ -430,12 +430,13 @@
 <v t="ekr.2008020219031​8"><vh>a​</vh></v>
 <v t="ekr.2008020219031​8.1"><vh>b​</vh></v>​
 <v t="ekr.2008020219380​2"><vh>c​</vh></v>
+<v t="vivainio.20080204​194357"><vh​>foo</vh></​v>
 </v>
 <v t="ekr.2008020115252​9.1"><vh>@b​utton get-ipython-results @key = alt-5</vh></v>
 <v t="ekr.2008020115253​5"><vh>@but​ton exec-ipython-script @key = alt-6</vh></v>
-<v t="ekr.20080202172207" a="ETV"><vh>inject an object</vh>
+<v t="ekr.20080202172207" a="E"><vh>inject an object</vh>
 <v t="ekr.2008020219360​7"><vh>crea​teNode</vh>​</v>
-<v t="ekr.2008020219360​7.1"><vh>cl​ass leoInterfaceResults​</vh></v>​
+<v t="ekr.20080202193607.1" a="TV"><vh>class leoInterfaceResults​</vh></v>​
 <v t="ekr.2008020219360​7.2"><vh>cl​ass leoInterface</vh​></v>
 </v>
 </v>
@@ -21122,7 +21123,8 @@
     return p
 
 </t>
-<t tx="ekr.200802021936​07.1">class leoInterfaceResults:
+<t tx="ekr.200802021936​07.1">import IPython.genutils
+class leoInterfaceResults:
     def __init__(self,c,g,root):
         assert(root)
         self._c,self._g,self._root = c,g,root
@@ -21135,6 +21137,16 @@
             # Allow attributes to be set in the ctor.
             # print '__setattr__','item'​,item,'value',value
             self.__dict__ [item] = value
+ def __getattr__(self, key):
+ tgt = None
+ for n in self._root.children_iter():
+ if n.headString() == key:
+ tgt = n
+ break
+ if not tgt:
+ raise AttributeError
+ return IPython.genutils.SLi​st(tgt.bodyString().​splitlines())
+
 
 </t>
 <t tx="ekr.200802021936​07.2">class leoInterface:
@@ -21164,5 +21176,8 @@
 f.close()
 g.es('wrote: %s' % (path),color="turquoise4")
 </t>
+<t tx="vivainio.2008020​4194357">hello
+world
+</t>
 </tnodes>
 </leo_file>

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /leo/test/test.leo vivainio Ville M. Vainio 2008-02-04 10:04:19 PST
Messages per page: