예제 #1
0
def init():

    ok = temacs and Tk and not g.app.unitTesting

    if ok:
        if g.app.gui is None:
            g.app.createTkGui(__file__)

        if g.app.gui.guiName() == "tkinter":
            global orig_Bindings, orig_OnBodyKey
            #@            << override createBindings and onBodyKey >>
            #@+node:ekr.20041106100326.2:<< override createBindings and onBodyKey >>
            orig_Bindings = leoTkinterFrame.leoTkinterBody.createBindings
            leoTkinterFrame.leoTkinterBody.createBindings = initialise(
            )  #createBindings

            orig_OnBodyKey = leoTkinterFrame.leoTkinterBody.onBodyKey
            leoTkinterFrame.leoTkinterBody.onBodyKey = modifyOnBodyKey
            #@nonl
            #@-node:ekr.20041106100326.2:<< override createBindings and onBodyKey >>
            #@nl
            loadConfig()
            g.plugin_signon(__name__)
            leoPlugins.registerHandler(('open2', "new"), addMenu)

    return ok
예제 #2
0
def init ():
    
    ok = temacs and Tk and not g.app.unitTesting
    
    if ok:
        if g.app.gui is None: 
            g.app.createTkGui(__file__)
    
        if g.app.gui.guiName() == "tkinter":
            global orig_Bindings,orig_OnBodyKey
            #@            << override createBindings and onBodyKey >>
            #@+node:ekr.20041106100326.2:<< override createBindings and onBodyKey >>
            orig_Bindings = leoTkinterFrame.leoTkinterBody.createBindings
            leoTkinterFrame.leoTkinterBody.createBindings = initialise() #createBindings
            
            orig_OnBodyKey = leoTkinterFrame.leoTkinterBody.onBodyKey
            leoTkinterFrame.leoTkinterBody.onBodyKey = modifyOnBodyKey
            #@nonl
            #@-node:ekr.20041106100326.2:<< override createBindings and onBodyKey >>
            #@nl
            loadConfig()
            g.plugin_signon(__name__)
            leoPlugins.registerHandler( ('open2', "new") , addMenu )
            
    return ok
예제 #3
0
def init():
    ok = Tk and not g.app.unitTesting
    if ok:
        # leoPlugins.registerHandler("after-create-leo-frame", maximize_window)
        leoPlugins.registerHandler(('new','open2'), maximize_window)
        g.plugin_signon(__name__)
    return ok
예제 #4
0
def init():
    
    ok = not g.app.unitTesting # Dangerous for unit testing.
    if ok:
        leoPlugins.registerHandler("icondclick1", onIconDoubleClick)
        g.plugin_signon(__name__)
    return ok
예제 #5
0
def init():

    if ok:
        leoPlugins.registerHandler(('open2',"new"),onCreate)
        g.plugin_signon(__name__)

    return ok
def init ():

    ok = Tkinter and sets
    if ok:
        leoPlugins.registerHandler(('open2',"new"),addMenu)
        leoPlugins.registerHandler("after-redraw-outline",drawImages)
        g.plugin_signon(__name__)
    return ok
def init ():
    
    # At present there is a problem with the interaction of this plugin and the chapters2 plugin.
    ok = Pmw is not None # and 'chapters2' not in leoPlugins.loadedModules

    if ok:
        g.plugin_signon( __name__ )
    return ok
예제 #8
0
def init ():

    if 1: # Ok for unit testing: creates a new menu.
    
        # Register the handlers...
        leoPlugins.registerHandler("after-create-leo-frame", onCreate)
    
        g.plugin_signon(__name__)
예제 #9
0
def init():
    leoPlugins.registerHandler(('new','open2'), on_open)
    leoPlugins.registerHandler("save1", on_save)
    leoPlugins.registerHandler("save2", on_open)
    leoPlugins.registerHandler("icondclick1", on_icondclick)

    g.plugin_signon(__name__)

    return 1
예제 #10
0
def init ():
    
    ok = Pmw and Tk
    
    if ok:
        leoPlugins.registerHandler('before-create-leo-frame',onCreate)
        g.plugin_signon(__name__)

    return ok
예제 #11
0
def init ():
    
    ok = True # This might depend on imports, etc.
    
    if ok:
        leoPlugins.registerHandler('after-create-leo-frame',onCreate)
        g.plugin_signon("newButtons")
            
    return ok
예제 #12
0
def init ():
    
    ok = client is not None # Ok for unit test: just uses Plugins menu.

    if ok:
        # No hooks, we just use the cmd_Export to trigger an export
        g.plugin_signon("word_export")
        
    return ok
def init ():

    ok = tkFileDialog is not None
    
    if ok:
        leoPlugins.registerHandler(("new2","open2"), onCreate)
        g.plugin_signon(__name__)

    return ok
예제 #14
0
def init ():
    
    ok = Tk and Pmw # Ok for unit test: adds tabbed pane to log.
    
    if ok:
        leoPlugins.registerHandler(('new','open2'), addURLPane)
        g.plugin_signon( __name__ )
        
    return ok
예제 #15
0
def init ():
    
    ok = not g.app.unitTesting
        
    if ok:
        leoPlugins.registerHandler("all",trace_tags)
        g.plugin_signon(__name__)
        
    return ok
예제 #16
0
def init ():
    
    ok = Tk is not None # Ok for unit tests: adds menu.
    
    if ok:
        leoPlugins.registerHandler(('new','open2'),addPMenu)
        g.plugin_signon( __name__ )

    return ok
예제 #17
0
def init ():
    
    ok = Pmw and Tk and tktab # Ok for unit testing.
    
    if ok: 
        leoPlugins.registerHandler(('new','open2'),addMenu )
        g.plugin_signon( __name__ )
        
    return ok
예제 #18
0
def init():

    if not Gato_ok:
        g.es('graphed: Gato import failed, functions reduced',color='red')

    leoPlugins.registerHandler('after-create-leo-frame', onCreate)
    g.plugin_signon(__name__)

    return True
예제 #19
0
def init():
    
    ok = Ft and Tk

    if ok:
        leoPlugins.registerHandler(('open2',"new"),addMenu)
        g.plugin_signon(__name__)

    return ok
예제 #20
0
def init ():
    
    ok = Pmw and Tk and not g.app.unitTesting # Not for unit tests: modifies core classes.
    
    if ok:
        leoTkinterFrame.leoTkinterBody.createControl = newCreateControl 
        leoPlugins.registerHandler(('new','open2'),initialScan)   
        g.plugin_signon(__name__)
        
    return ok
예제 #21
0
파일: gtkDialogs.py 프로젝트: AG4GitHub/leo
def init():

    if g.unitTesting:
        return False

    if ok:
        leoPlugins.registerHandler('start2', onStart2)
        g.plugin_signon(__name__)

    return ok
예제 #22
0
def init ():

    ok = True # not  g.app.unitTesting:

    # Register the handlers...
    leoPlugins.registerHandler("start1",addPluginDirectives)
    leoPlugins.registerHandler("scan-directives",scanPluginDirectives)
    g.plugin_signon(__name__)

    return ok
예제 #23
0
def init ():

    if 1: # Ok for unit testing.
        leoPlugins.registerHandler("bodykey2",OnBodyKey)
        leoPlugins.registerHandler("icondclick2",OnIconDoubleClick)
        leoPlugins.registerHandler("end1",OnQuit)
        leoPlugins.registerHandler("idle",OnIdle)
        g.plugin_signon(__name__)

    return True
예제 #24
0
def init ():
    
    # Override the base class
    leoPlugins.registerHandler('start1',onStart2)

    # Register the commands.
    leoPlugins.registerHandler(('open2','new'),onCreate)
    
    g.plugin_signon(__name__)

    return True
예제 #25
0
def init ():

    if g.unitTesting:
        return False

    if ok:
        leoPlugins.registerHandler('start2', onStart2)
        g.plugin_signon(__name__)


    return ok
예제 #26
0
def init ():
    
    if ok:
        g.globalDirectiveList.append( 'multipath' ) 
        g.globalDirectiveList.append( 'multiprefix' ) 
        registerHandler( 'save1' , start )
        registerHandler( 'save2', stop )
        registerHandler(('new', 'start2'),addMenu )
        g.plugin_signon(__name__)  

    return ok
예제 #27
0
def init ():
    
    ok = Tk is not None
    
    if ok: # Ok for unit testing: adds menu and new directive.

        leoPlugins.registerHandler( ('new','open2') , addMenu )
        g.globalDirectiveList.append( 'produce' ) 
        g.plugin_signon( __name__ )
    
    return ok
예제 #28
0
def init ():

    if g.app.gui is None:
        g.app.createTkGui(__file__)

    ok = g.app.gui.guiName() == "tkinter"

    if ok:
        leoPlugins.registerHandler('after-create-leo-frame',onCreate)
        g.plugin_signon("newButtons")

    return ok
예제 #29
0
def init ():

    if g.app.gui is None:
        g.app.createTkGui(__file__)

    if g.app.gui.guiName() in ('tkinter','wxPython'):
        leoPlugins.registerHandler("after-create-leo-frame", createStatusLine)
        leoPlugins.registerHandler("select2", onSelect2)    # show UNL
        leoPlugins.registerHandler("@url1", onUrl1)         # jump to URL or UNL

        g.plugin_signon(__name__)
        return True
예제 #30
0
def init ():
    
    if Tk: # OK for unit tests.
    
        if g.app.gui is None:
            g.app.createTkGui(__file__)
    
        if g.app.gui.guiName() == "tkinter":
            leoPlugins.registerHandler("after-create-leo-frame",rClickbinder)
            leoPlugins.registerHandler("bodyrclick1",rClicker)
            g.plugin_signon(__name__)
            
    return Tk is not None
예제 #31
0
def init ():
    
    ok = Tk is not None
    
    if ok:
        if g.app.gui is None:
            g.app.createTkGui(__file__)

        if g.app.gui.guiName() == "tkinter":
            leoPlugins.registerHandler('after-create-leo-frame',onCreate)
            g.plugin_signon(__name__)
            
    return ok
예제 #32
0
def init ():

    ok = tkFileDialog is not None

    if ok:
        if g.app.gui is None:
            g.app.createTkGui(__file__)

        if g.app.gui.guiName() == "tkinter":
            leoPlugins.registerHandler(('new','open2'),create_import_cisco_menu)
            g.plugin_signon(__name__)

    return ok
예제 #33
0
def init():

    if g.app.unitTesting:  # Not Ok for unit testing!
        return False

    if not gtk:
        return False

    if g.app.gui:
        return g.app.gui.guiName() == 'gtk'
    else:
        g.app.gui = leoGtkGui.gtkGui()
        # g.app.root = g.app.gui.createRootWindow()
        g.app.gui.finishCreate()
        g.plugin_signon(__name__)
        return True
예제 #34
0
def init():

    #ok = Tk and not g.app.unitTesting
    ok = 1

    if ok:
        #if g.app.gui is None:
        #    g.app.createTkGui(__file__)

        #ok = g.app.gui.guiName() == "tkinter"

        if ok:
            # Note: call onCreate _after_ reading the .leo file.
            # That is, the 'after-create-leo-frame' hook is too early!
            #import java
            leoPlugins.registerHandler(("start2", "new", "open2"), onCreate)
            g.plugin_signon(__name__)

    return ok
예제 #35
0
def init():	
    import leoPlugins
    leoPlugins.registerHandler( "start2", addToMenu )
    g.plugin_signon( __name__)
예제 #36
0
def init():
    import leoPlugins
    leoPlugins.registerHandler("script_executor_created", addHandler)
    g.plugin_signon(__name__)
예제 #37
0
def init():	
    import leoPlugins
    leoPlugins.registerHandler( "body_pane_added", addHandler )
    g.plugin_signon( __name__)
예제 #38
0
def init():
    import leoPlugins
    leoPlugins.registerHandler("leoswinglogcreated", addCommentary)
    g.plugin_signon(__name__)
예제 #39
0
def init():
    if load_ok:
        import leoPlugins
        leoPlugins.registerHandler("editor-created", onCreate)
        g.plugin_signon(__name__)
예제 #40
0
                        items.sort()
                        table.extend(items)
                    c.frame.menu.createMenuEntries(m, table)
                else:
                    table = ((p.name, None, p.about), )
                    c.frame.menu.createMenuEntries(PluginDatabase.getMenu(p),
                                                   table)
            #@nonl
            #@-node:EKR.20040517080555.24:<< add items to the plugins menu >>
            #@nl

    sys.path = old_path


#@nonl
#@-node:EKR.20040517080555.23:createPluginsMenu
#@-others

if not g.app.unitTesting:  # Register the handlers...

    #if g.app.gui is None:
    #    g.app.createTkGui(__file__)

    #if g.app.gui.guiName() == "tkinter":
    if 1:
        leoPlugins.registerHandler("create-optional-menus", createPluginsMenu)
        g.plugin_signon(__name__)
#@nonl
#@-node:EKR.20040517080555.2:@thin plugins_menu.py
#@-leo