On Tue, Jul 29, 2014 at 2:32 PM, Edward K. Ream <edream...@gmail.com> wrote:
> It looks like the problem is that the list of @auto nodes is too > static. In fact, it is located inside at.anyAtFileNodeName. > Naturally, @auto-test is not part of the list. > > The solution is to make the list visible and extensible, and have > ic.parse_importer_dict add entries to it. Probably something similar > for writers. > > Thanks, Terry, for getting the ball rolling. I'll have a fix later > today or tomorrow. Here is my version of modes/test.py: QQQQQ '''The @auto importer for .xyzzy files and @auto-test nodes.''' import leo.core.leoGlobals as g import leo.plugins.importers.basescanner as basescanner tag = '(test)' print('%s importing test.py' % ('='*20)) class TestScanner(basescanner.BaseScanner): def __init__(self,importCommands,atAuto): g.trace(tag) basescanner.BaseScanner.__init__( self,importCommands,atAuto=atAuto,language='test') def run(self,s,parent,parse_body=False,prepass=False): g.trace(tag) return True def scan (self,s,parent,parse_body=False): g.trace(tag) return True importer_dict = { '@auto': ['@auto-test',], 'class': TestScanner, 'extensions': ['.xyzzy',], } QQQQQ This code will be executed for @auto whatever.xyzzy nodes. Naturally, the importer doesn't populate the tree properly. This shows, I think that the only remaining problem is the recognition of @auto-test nodes. Edward P.S. As of rev e8eec77...Leo now guarded the calls to the TestScanner methods in the dispatch methods in leoImport.py and leoAtFile.py. Previously, syntax or run-time errors in an importer or writer would crash Leo. EKR -- 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 leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at http://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.