On Tue, 29 Jul 2014 09:13:29 -0500 "Edward K. Ream" <[email protected]> wrote:
> On Tue, Jul 29, 2014 at 8:50 AM, 'Terry Brown' via leo-editor > <[email protected]> wrote: > > > File > > "/mnt/usr1/usr1/home/tbrown/Package/leo/git/leo-editor/leo/plugins/importers/test.py", > > line 6, in __init__ return BaseScanner.__init__(self, *args, > > **kwargs) > > You must not return a value from a ctor. Whoops, true of course. So now my importer is: from basescanner import BaseScanner print 'TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT' class TestScanner(BaseScanner): #def __init__(self, *args, **kwargs): # print 'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ' # BaseScanner.__init__(self, *args, **kwargs) def run(self,s,parent,parse_body=False,prepass=False): print 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' return True def scan (self,s,parent,parse_body=False): print 'YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY' return True importer_dict = { '@auto': ['@auto-test',], 'class': TestScanner, 'extensions': ['.txt',], } and I'm still getting Traceback (most recent call last): File "/mnt/usr1/usr1/home/tbrown/Package/leo/git/leo-editor/leo/core/leoCommands.py", line 2473, in executeScript c.executeScriptHelper(args,define_g,define_name,namespace,script) File "/mnt/usr1/usr1/home/tbrown/Package/leo/git/leo-editor/leo/core/leoCommands.py", line 2511, in executeScriptHelper execfile(scriptFile,d) File "/home/tbrown/.leo/scriptFile.py", line 5, in <module> atAuto=True,atShadow=False,s=None,ext=None) File "/mnt/usr1/usr1/home/tbrown/Package/leo/git/leo-editor/leo/core/leoImport.py", line 560, in createOutline func(atAuto=atAuto,parent=p,s=s) File "/mnt/usr1/usr1/home/tbrown/Package/leo/git/leo-editor/leo/core/leoImport.py", line 611, in scanner_for_at_auto_cb scanner = aClass(importCommands=self,atAuto=atAuto) TypeError: __init__() takes at least 4 arguments (3 given) when I force it to run with ic = c.importCommands ic.createOutline('~/r/foo.txt',p, atAuto=True,atShadow=False,s=None,ext=None) although I still expect it to run simply because I have a `@auto-test ~/r/foo.txt` node in the outline I'm opening (in a separate Leo instance). Cheers -Terry -- 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.
