So I have a module which *is* a Leo plugin, although I'm also interested in the 
case where the module isn't related to Leo.

So, I have a top level function in the module, I think they question would be 
the same if it was a class.  How do I refer to that function / class from a 
@test node?

Do I have to import it?  The module won't necessarily be on the import path, of 
course.

In a @thin file mytest.py which has two child nodes:

func
  def func(x):
      print 'X'  
@test test1
  import sys
  sys.path.insert(0,'/home/tbrown/Desktop')
  import mytest
  import leo.core.leoGlobals as g
  
  if g.unitTesting:
    mytest.func(0)

you can see all the fiddling I had to do to reference func.  The module imports 
itself, I guess it seems to be working, but eww.

Am I doing this all wrong?

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to