示例#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
示例#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
示例#3
0
def init():
    """Leo plugin init. function"""
    g.registerHandler('after-create-leo-frame',onCreate)

    g.plugin_signon(__name__)

    return True
示例#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
示例#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
示例#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
示例#7
0
def init():
    if 1: # OK for unit testing.

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

        return True
示例#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
示例#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
示例#10
0
def init ():
    ok = True

    if ok:
        g.plugin_signon(__name__)

    return ok
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#23
0
def init ():

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

    return True
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#32
0
def init():

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

    return True
示例#33
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    leoPlugins.registerHandler(('open2', 'new'), onCreate)
    g.plugin_signon(__name__)
    return True
示例#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.
示例#35
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler('save1', beforeSave)
    g.plugin_signon(__name__)
    return True
示例#36
0
def init ():
    g.plugin_signon(__name__)
    return True
示例#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.
示例#38
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    g.plugin_signon(__name__)
    return True
示例#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
示例#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
示例#41
0
def init ():
    g.registerHandler(('new','open2'), onCreate)
    g.registerHandler(('save1'), onSave)
    g.plugin_signon(__name__)
    return True
示例#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
示例#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
示例#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
示例#45
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    leoPlugins.registerHandler("after-auto", InitInClass)
    g.plugin_signon(__name__)
    return True
示例#46
0
def init():
    '''Top-level init function for qt_commands.py.'''
    ok = True
    g.plugin_signon(__name__)
    g.registerHandler("select2", onSelect)
    return ok
示例#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
示例#48
0
def init():
    '''Return True if the plugin has loaded successfully.'''
    leoPlugins.registerHandler(('new', 'menu2'), CreateAscMenu)
    g.plugin_signon(__name__)
    return True
示例#49
0
 def init():
     ok = True
     leoPlugins.registerHandler(('new','menu2'), CreateAscMenu)
     g.plugin_signon(__name__)
     return ok
示例#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
示例#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
示例#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
示例#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
示例#54
0
def init():

    # Ok for unit testing: creates menu.
    g.registerHandler("create-optional-menus", createExportMenu)
    g.plugin_signon(__name__)
    return True
示例#55
0
def init():
    g.registerHandler("select1", onSelect)
    g.plugin_signon(__name__)
示例#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
示例#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.
示例#58
0
文件: xemacs.py 项目: AG4GitHub/leo
def init():
    ok = not g.unitTesting
    if ok:
        # g.registerHandler("icondclick2", open_in_emacs)
        g.plugin_signon(__name__)
    return ok
示例#59
0
def init():
    """Return True if the plugin has loaded successfully."""
    ok = not g.unitTesting
    if ok:
        g.plugin_signon(__name__)
    return ok
示例#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