예제 #1
0
# 0.6 EKR: (eliminated g.top)
#     - Add c arg to writeNodeAndTree.
#     - Set encoding to sys.getdefaultencoding() if there is no @encoding directive in effect.
# 0.7 EKR: cmd_ functions now get c arg.
# 0.8 EKR: set __plugin_name__ rather than __name__
#@-<< version history >>
#@+<< imports >>
#@+node:ekr.20040909105522: ** << imports >>
import leo.core.leoGlobals as g

try:
    # From win32 extensions: http://www.python.org/windows/win32/
    import win32com.client
    client = win32com.client
except ImportError:
    client = g.cantImport('win32com.client')

if g.isPython3:
    import configparser as ConfigParser
else:
    import ConfigParser

import sys

#@-<< imports >>


#@+others
#@+node:ekr.20050311165238: ** init
def init():
    '''Return True if the plugin has loaded successfully.'''
예제 #2
0
#       That is, not installed properly by unit tests.
#
# 0.3 EKR:
#     - Declared click_registry and coloured_nodes global in init.
#@-<< version history >>
#@+<< imports >>
#@+node:pap.20041020001240.2: ** << imports >>
import leo.core.leoGlobals as g

import leo.plugins.tkGui as tkGui
leoTkinterTree = tkGui.leoTkinterTree

try:
    import Tkinter as Tk
except ImportError:
    Tk = g.cantImport("Tkinter")

if g.isPython3:
    import configparser as ConfigParser
else:
    import ConfigParser

import threading
import time

#@-<< imports >>


#@+others
#@+node:ekr.20050310105438: ** init
def init():
예제 #3
0
#@+leo-ver=5-thin
#@+node:ekr.20050130120433: * @file test/failed_import.py
'''A plugin to test import problems.'''

import leo.core.leoGlobals as g

def onStart(tag, keywords):
    pass

# pylint: disable=unused-import
try:
    import xyzzy
except ImportError:
    g.cantImport('xyzzy', pluginName='failed_import')

def init():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler("start2", onStart)
    g.plugin_signon(__name__)
    return True
#@-leo
예제 #4
0
from xml.dom import minidom

if g.isPython3:
    import io
    StringIO = io.StringIO
else:
    import cStringIO
    StringIO = cStringIO.StringIO

try:
    import Ft
    from Ft.Xml import InputSource
    from Ft.Xml.Xslt.Processor import Processor
except ImportError:
    g.cantImport("Ft",__name__)
    Ft = None

import weakref
#@-<< imports >>
#@+<<parser problems>>
#@+node:mork.20041024091024: ** <<parser problems>>
#@@killcolor

#@+at
# 1. Having space before the start of the document caused it not to work.  I fixed this by striping the whitespace from the start
# and end of the data at xslt time.
# 
# 2. having a @ right before a tag causes it to not process.
#     It appears to be safe to follow this pattern:
#     @ </end>
예제 #5
0
#       That is, not installed properly by unit tests.
# 
# 0.3 EKR:
#     - Declared click_registry and coloured_nodes global in init.
#@-<< version history >>
#@+<< imports >>
#@+node:pap.20041020001240.2: ** << imports >>
import leo.core.leoGlobals as g 

import leo.plugins.tkGui as tkGui
leoTkinterTree = tkGui.leoTkinterTree

try: 
    import Tkinter as Tk 
except ImportError: 
    Tk = g.cantImport("Tkinter")

if g.isPython3:
    import configparser as ConfigParser
else:
    import ConfigParser

import threading 
import time 

#@-<< imports >>

#@+others
#@+node:ekr.20050310105438: ** init
def init ():
예제 #6
0
from xml.dom import minidom

if g.isPython3:
    import io
    StringIO = io.StringIO
else:
    import cStringIO
    StringIO = cStringIO.StringIO

try:
    import Ft
    from Ft.Xml import InputSource
    from Ft.Xml.Xslt.Processor import Processor
except ImportError:
    g.cantImport("Ft",__name__)
    Ft = None

import weakref
#@-<< imports >>
#@+<<parser problems>>
#@+node:mork.20041024091024: ** <<parser problems>>
#@@killcolor

#@+at
# 1. Having space before the start of the document caused it not to work. I fixed
#    this by striping the whitespace from the start and end of the data at xslt
#    time.
# 
# 2. having a @ right before a tag causes it to not process.
#     It appears to be safe to follow this pattern:
예제 #7
0
#@+leo-ver=5-thin
#@+node:ekr.20050130120433: * @file test/failed_import.py
'''A plugin to test import problems.'''

import leo.core.leoGlobals as g

def onStart(tag,keywords):
    pass

# pylint: disable=unused-import
try:
    import xyzzy
except ImportError:
    g.cantImport('xyzzy',pluginName='failed_import')

def init():
    '''Return True if the plugin has loaded successfully.'''
    g.registerHandler("start2", onStart)
    g.plugin_signon(__name__)
    return True
#@-leo
예제 #8
0
# 0.6 EKR: (eliminated g.top)
#     - Add c arg to writeNodeAndTree.
#     - Set encoding to sys.getdefaultencoding() if there is no @encoding directive in effect.
# 0.7 EKR: cmd_ functions now get c arg.
# 0.8 EKR: set __plugin_name__ rather than __name__
#@-<< version history >>
#@+<< imports >>
#@+node:ekr.20040909105522: ** << imports >>
import leo.core.leoGlobals as g

try:
    # From win32 extensions: http://www.python.org/windows/win32/
    import win32com.client
    client = win32com.client
except ImportError:
    g.cantImport('win32com.client')
    client = None

if g.isPython3:
    import configparser as ConfigParser
else:
    import ConfigParser

import sys
#@-<< imports >>

#@+others
#@+node:ekr.20050311165238: ** init
def init ():
    '''Return True if the plugin has loaded successfully.'''
    ok = client is not None # Ok for unit test: just uses Plugins menu.