Ejemplo n.º 1
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    ok = not g.app.unitTesting # Not for unit tests.
    if ok: # Register the handlers...
        g.registerHandler("start2", onStart)
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 2
0
def init ():
    '''Return True if the plugin has loaded successfully.'''
    ok = g.app.gui.guiName() == "qt"
    if ok:
        g.app._global_search = GlobalSearch()
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 3
0
def init():
    """Leo plugin init. function"""
    g.registerHandler('after-create-leo-frame',onCreate)

    g.plugin_signon(__name__)

    return True
Ejemplo n.º 4
0
def init ():

    g.registerHandler('new', new_hook)
    g.registerHandler('create-node', create_node_hook)
    g.registerHandler('select1', select1_hook)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 5
0
def init ():
        
    ok = g.app.gui.guiName() in ('qt','qttabs')
    if ok:
        g.registerHandler('after-create-leo-frame',onCreate)
        g.plugin_signon(__file__)
    return ok
Ejemplo n.º 6
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    ok = bool(QtSvg and QtWebKitWidgets)
    g.plugin_signon(__name__)
    g.registerHandler('after-create-leo-frame', onCreate)
    g.registerHandler('scrolledMessage', show_scrolled_message)
    return ok
Ejemplo n.º 7
0
def init():
    if 1: # OK for unit testing.

        g.registerHandler("after-create-leo-frame", on_create)
        g.plugin_signon(__name__)

        return True
Ejemplo n.º 8
0
def init ():

    import leo.core.leoGlobals as g
    # print("bigdash init")
    
    set_leo(g)
    ok = g.app.gui.guiName() == "qt"

    g._global_search = None
    if ok:        
        @g.command("global-search")
        def global_search_f(event):
            """ Do global search """
            c = event['c']
            if g._global_search:
                
                g._global_search.show()
            else:
                g._global_search = gs = GlobalSearch()
                set_leo(g)
                if leofts:
                    leofts.init()
                        
                        
        g.plugin_signon(__name__)

    return ok
Ejemplo n.º 9
0
def init ():
    '''Return True if the plugin has loaded successfully.'''
    ok = g.app.gui.guiName() == "qt"
    if ok:
        g.plugin_signon(__name__)
    install_contextmenu_handlers()
    return ok
Ejemplo n.º 10
0
def init ():
    ok = True

    if ok:
        g.plugin_signon(__name__)

    return ok
Ejemplo n.º 11
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    ok = g.app.gui.guiName() in ('qt', 'qttabs')
    if ok:
        g.registerHandler('after-create-leo-frame', onCreate)
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 12
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    ok = g.app.gui.guiName() == "qt"
    if ok:
        g.registerHandler('select1', onSelect)
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 13
0
def init ():
    '''Return True if the plugin has loaded successfully.'''
    # Note: call onCreate _after_ reading the .leo file.
    # That is, the 'after-create-leo-frame' hook is too early!
    g.registerHandler(('new','open2'),onCreate)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 14
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    ok = Ft
    if ok:
        g.registerHandler(('menu2',"new"),addMenu)
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 15
0
def init ():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler("create-optional-menus",createExportMenus)
    g.registerHandler('after-create-leo-frame', onCreate)
    g.plugin_signon(__name__)
    # I think this should be ok for unit testing.
    return True
Ejemplo n.º 16
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler('after-create-leo-frame', onCreate)
    g.plugin_signon(__name__)
    if '_quickmove' not in g.app.db:
        g.app.db['_quickmove'] = {'global_targets': []}
    return True
Ejemplo n.º 17
0
def init():
    ok = not g.app.unitTesting # Not safe for unit testing.  Changes core class.
    if ok:
        #@+<< override write methods >>
        #@+node:ekr.20040419105219.1: ** << override write methods >>
        oldOpenNodeSentinel = leoAtFile.atFile.putOpenNodeSentinel

        def putLineNumberDirective(self,v,inAtAll=False,inAtOthers=False,middle=False):

            oldOpenNodeSentinel(self,v,inAtAll,inAtOthers,middle)

            if self.language in ("perl","perlpod"):
                line = 'line 1 "node:%s (%s)"' % (self.nodeSentinelText(v),self.shortFileName)
                self.putSentinel(line)

        g.funcToMethod(putLineNumberDirective,	
            leoAtFile.atFile,"putOpenNodeSentinel")
        #@-<< override write methods >>
        #@+<< override read methods >>
        #@+node:ekr.20040419105219.2: ** << override read methods >>
        readNormalLine = leoAtFile.atFile.readNormalLine

        def skipLineNumberDirective(self, s, i):

            if linere.search(s): 
                return  # Skipt the line.
            else:		
                readNormalLine(self,s,i)

        g.funcToMethod(skipLineNumberDirective,
            leoAtFile.atFile,"readNormalLine")
        #@-<< override read methods >>
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 18
0
def init ():
    '''Return True if the plugin has loaded successfully.'''
    ok = not g.app.unitTesting
    if ok:
        g.registerHandler("all",trace_tags)
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 19
0
def init():

    ok = not g.app.unitTesting # Dangerous for unit testing.
    if ok:
        g.registerHandler("icondclick1", onIconDoubleClick)
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 20
0
def init ():
    '''Return True if the plugin has loaded successfully.'''
    ok = g.app.gui.guiName() == 'qt'
    if ok:
        g.plugin_signon(__name__)
    g.app.stickynotes = {}
    return ok
Ejemplo n.º 21
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    ok = not g.app.unitTesting # Not for unit testing.
    if ok:
        g.registerHandler(("bodykey1","bodykey2","headkey1","headkey2"), onKey)
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 22
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    ok = not g.unitTesting
        # Not for unit testing: overrides core methods.
    if ok:
        if 0:
            # Override the LeoFrame class.
            class myLeoFrame(leoFrame.LeoFrame):
                def __init__(self,title=None):
                    g.pr("myLeoFrame ctor",title)
                    leoFrame.LeoFrame.__init__(self,title)
            leoFrame.LeoFrame = myLeoFrame
            
        if 0:
            # Override methods of the LeoApp class.
            oldAppCloseLeoWindow = g.app.closeLeoWindow

            def myAppCloseLeoWindow(self,frame):
                global oldAppCloseLeoWindow
                oldAppCloseLeoWindow(frame)
                g.trace("after closeLeoWindow")
            
            g.funcToMethod(myAppCloseLeoWindow,leoApp.LeoApp,"closeLeoWindow")
            
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 23
0
def init ():

    # Ok for unit testing: adds command to Outline menu.
    g.registerHandler( ('new','menu2') ,onCreate)
    g.plugin_signon(__name__)

    return True
Ejemplo n.º 24
0
def init ():
    '''Return True if the plugin has loaded successfully.'''
    ok = g.app.gui.guiName() == "qt"
    g.plugin_signon(__name__)
    g._mylyn = ctr = MylynController()
    ctr.set_handlers()
    return ok
Ejemplo n.º 25
0
def init ():
    '''Return True if the plugin has loaded successfully.'''
    ok = not g.unitTesting
    if ok:
        # g.registerHandler("icondclick2", open_in_emacs)
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 26
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    if g.unitTesting:
        return False
    ok = g.app.gui.guiName() == 'qt'
    g.plugin_signon(__name__)
    return ok
Ejemplo n.º 27
0
def init ():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler('new', new_hook)
    g.registerHandler('create-node', create_node_hook)
    g.registerHandler('select1', select1_hook)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 28
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    ok = not g.app.unitTesting # Dangerous for unit testing.
    if ok:
        g.registerHandler("icondclick1", onIconDoubleClick)
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 29
0
def init ():
    '''Return True if the plugin has loaded successfully.'''
    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(__name__)
    return ok
Ejemplo n.º 30
0
def init ():
    '''Return True if the plugin has loaded successfully.'''
    ok = bool(Template)
    if ok:
        g.plugin_signon(__name__)
        jinja_install()
    return ok
Ejemplo n.º 31
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler('after-create-leo-frame',onCreate)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 32
0
def init():

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

    return True
Ejemplo n.º 33
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    leoPlugins.registerHandler(('open2', 'new'), onCreate)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 34
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler("create-optional-menus", createPasteAsHeadlinesMenu)
    g.plugin_signon(__name__)
    return True  # Ok for unit testing: creates menu.
Ejemplo n.º 35
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler('save1', beforeSave)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 36
0
def init ():
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 37
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler("after-create-leo-frame", on_create)
    g.plugin_signon(__name__)
    return True  # OK for unit testing.
Ejemplo n.º 38
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 39
0
def init():
    """ Return True if plugin has loaded successfully."""
    if ok:
        g.plugin_signon(__name__)
        g.act_on_node.add(anki_act_on_node, 50)
    return ok
Ejemplo n.º 40
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    leoPlugins.registerHandler("after-create-leo-frame", maximize_window)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 41
0
def init ():
    g.registerHandler(('new','open2'), onCreate)
    g.registerHandler(('save1'), onSave)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 42
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler("select1", onSelect)
    g.plugin_signon(__name__)
    # Fix https://bugs.launchpad.net/leo-editor/+bug/1335310
    return True
Ejemplo n.º 43
0
def init ():
    '''Return True if this plugin loaded correctly.'''
    # Ok for unit testing: adds command to Outline menu.
    g.registerHandler( ('new','menu2') ,onCreate)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 44
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    # g.registerHandler(('new','menu2'),addMenu)
    g.globalDirectiveList.append('produce')
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 45
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    leoPlugins.registerHandler("after-auto", InitInClass)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 46
0
def init():
    '''Top-level init function for qt_commands.py.'''
    ok = True
    g.plugin_signon(__name__)
    g.registerHandler("select2", onSelect)
    return ok
Ejemplo n.º 47
0
def init():
    """Return True if the plugin has loaded successfully."""
    # This plugin is gui-independent.
    g.registerHandler(('new', 'menu2'), create_import_cisco_menu)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 48
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    leoPlugins.registerHandler(('new', 'menu2'), CreateAscMenu)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 49
0
 def init():
     ok = True
     leoPlugins.registerHandler(('new','menu2'), CreateAscMenu)
     g.plugin_signon(__name__)
     return ok
Ejemplo n.º 50
0
def init():
    """Return True if the plugin has loaded successfully."""
    # 2031: Allow this plugin to run without Qt.
    g.registerHandler('after-create-leo-frame', onCreate)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 51
0
def init():
    """Return True if the plugin has loaded successfully."""
    g.registerHandler('after-create-leo-frame', DT)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 52
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    ok = True  # Ok for unit testing: creates menu.
    g.registerHandler("create-optional-menus", createWordCountMenu)
    g.plugin_signon(__name__)
    return ok
Ejemplo n.º 53
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    # This plugin is now gui independent.
    g.registerHandler(("new2", "menu2"), onCreate)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 54
0
def init():

    # Ok for unit testing: creates menu.
    g.registerHandler("create-optional-menus", createExportMenu)
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 55
0
def init():
    g.registerHandler("select1", onSelect)
    g.plugin_signon(__name__)
Ejemplo n.º 56
0
def init():
    g.registerHandler("start2", onStart)
        # Needed to have the plugin show in the Plugin Manager list.
    g.plugin_signon(__name__)
    return True
Ejemplo n.º 57
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler("command1", timestamp)
    g.plugin_signon(__name__)
    return True  # OK for unit testing.
Ejemplo n.º 58
0
def init():
    ok = not g.unitTesting
    if ok:
        # g.registerHandler("icondclick2", open_in_emacs)
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 59
0
def init():
    """Return True if the plugin has loaded successfully."""
    ok = not g.unitTesting
    if ok:
        g.plugin_signon(__name__)
    return ok
Ejemplo n.º 60
0
def init():
    ok = not g.app.unitTesting  # Not for unit tests.
    if ok:  # Register the handlers...
        g.registerHandler("start2", onStart)
        g.plugin_signon(__name__)
    return ok