Modifying the macros.py and printing out stuff with g.es shows that the regular expression used to parse the text in the A & B nodes does not expect any embedded blanks. The examples in the docstring all have embedded blanks which cause the regular expression parse to fail. So A should have <<meow(purrrrr,zzooooot)>> with no blanks and the parse will succeed. But two things are still missing from the result: A is not altered to contain the body text from the << Meow >> node and only one sub-node, <<2$>>, gets created instead of two (<<2$>> and <<1$>>). The <<2$>> node does have the correct content: zzooooot. In addition, when the cursor is placed at the end of the <<meow(purrrrr,zzooooot)>> data in the A node and Parameterize Scection Referece is selected from the Outline node, The <<$2>> node is given two empty sub-nodes. Finally, when meow is given three arguments, a <<3$>> node gets created, instead of <<2$>> with the correct content along with three empty sub-nodes.
On Thursday, December 11, 2014 1:52:56 PM UTC-6, bobS wrote: > > From the docstring for plugin macros.py, it seems as though the content of > the A node is changed into the body text for << Meow >> with the arguments > in A's << meow ( purrr, zzooooot ) >> as body text in sub-nodes of A. So > A's body would be changed to look the same as the << Meow >> body, with > sections << 1$ >> and << 2$ >> as sub-nodes below it. The cursor must be > placed where the x appears in the following line from A's body: > << meow ( purrr, zzzooooot ) >>x > before "Parameterize Section Reference" is selected in the Outline menu. > I've messed with capitalization of the M in Meow,etc. Any help would be > appreciated. > > Would someone who has made this work please explain how they did it? I > have probably misunderstood the docstring. > > On Tuesday, December 2, 2014 5:43:58 PM UTC-6, bobS wrote: >> >> Test Parameterized Nodes >> A >> body text: << meow ( purrrrr, zzooooot ) >> >> B >> body text: << meow ( spit, necessary ) >> >> Parameterized Nodes >> << Meow >> >> body text: I mmmm sooo happy I could << 1$ >>. >> But I don't know if I have all the << 2$ >> >> money. >> >> When I click on Parameterize Section Reference in the Outline menu, I get: >> >> exception executing command >> >> Traceback (most recent call last): >> >> >> File "/home/rshanley/Leo5.0-final/leo/core/leoCommands.py", line 556, in >> doCommand >> val = command(event) >> >> >> File "/home/rshanley/Leo5.0-final/leo/plugins/macros.py", line 111, in >> parameterize >> sr = s = body.getAllText() >> >> AttributeError: 'LeoQtBody' object has no attribute 'getAllText' >> >> >> PyQt4 is installed. >> > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
