本文整理汇总了Python中Plugins.registerTool方法的典型用法代码示例。如果您正苦于以下问题:Python Plugins.registerTool方法的具体用法?Python Plugins.registerTool怎么用?Python Plugins.registerTool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugins
的用法示例。
在下文中一共展示了Plugins.registerTool方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: in
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import registerTool [as 别名]
editor.openOrGotoModule(os.path.join(filename, '__init__.py'))
elif type in (imp.PY_SOURCE, imp.C_EXTENSION):
editor.openOrGotoModule(filename)
return
finally:
dlg.Destroy()
if wx.Platform == '__WXMSW__':
keyIdent = 'ModuleFinder'
Preferences.keyDefs[keyIdent] = (wx.ACCEL_ALT, ord('M'), 'Alt-M')
else:
keyIdent = ''
import Plugins
Plugins.registerTool(_('Module finder'), openModuleFinder,
'Images/ModuleFinder.png', keyIdent)
#-------------------------------------------------------------------------------
def getModuleFinderImgData():
return \
'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\
\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\
\x00\x01\x1aIDATx\x9c\xa5\x93]j\xc30\x10\x84?\x95\[email protected]\xd7\xf1\x12\x08\xd5\
\x89J\xf0[J\x7f\xc2\xe6-\x94\x9eH\x10\x12\xd6\xd7\xc9\x01\n\xdb\x07[\x8a\x9d\
\xba$\xa5\x0bb\xd7\x1efX\xcd\xa0\x10c\xe4?\xb5(C\xbbn\xfd\x1a\xdc\x7f\xec\
\xc3]\x02\xed\xba\xf5\xf4\x98\x90\xa5`\'\xab\x1d\xf0["\x8b\xdf\xc8\xb2\x14\
\x8c^d\x8eX\x85u\xab>.;\x9a\xab\xaa\xab\xaa\x03\xae:\xc5\xdd\xddu\xdbc1\xc6\
\x8b\x00N%\xfb\xf0\xc7\xdd\xabH\xc1q&\x02\xd5D;\x19\xf9\x90\[email protected]\x00\x9c\
\x00\x98\x19"\x82\xad.\xd7\xcb\xe4z\x95\x872\xc8R\x86\xa9\x90\x03\xd6uH\xd3T\
\xbcx3\xae*0\xb8>"\x1b\xd24X\xd7U|\x94\xce\xfc\x06i\x95\xd8\xedv\x13\xb2\x88\
示例2: setStatus
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import registerTool [as 别名]
def setStatus(self, mo):
if mo:
self.statusBar.SetStatusText(_('Match'), 1)
self.sbImage.SetBitmap(self.statusImages[1])
else:
self.statusBar.SetStatusText(_('Failed to match'), 1)
self.sbImage.SetBitmap(self.statusImages[0])
#-------------------------------------------------------------------------------
def openRegexEditor(editor):
frame = createRegexEditor(editor)
frame.Show()
Plugins.registerTool(_('Regex editor'), openRegexEditor, 'Images/RegexEditor.png')
#-------------------------------------------------------------------------------
def getRegexEditorImgData():
return \
'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x02\
\x00\x00\x00\x90\x91h6\x00\x00\x00\x03sBIT\x08\x08\x08\xdb\xe1O\xe0\x00\x00\
\x00\x9cIDAT(\x91\x95\x91Q\r\xc40\x0cC}\xa7\x01\x08\x84A0\xa4B\x18\x94Bh\xa1\
\x8c\x81!\x14B\x19t\x1f\xb9\x9bn\xd5mj\xfd\x95H~\xb2\xa3\xbcZk\x18V\xcey\x01\
\xb0\xef\xfb PJY|\x92df\x0fV\x92\xb5V\x00\x1f\xc0\xcc\xd6u}\x00\xcc\xcc\x81\
\xf7`\x99S\xd3\xc0\xf2\xbbH\xda\xb6\x8d_\xa5\x94\x00\xc4\x18o\x13H\xba\x83\
\xa4\x93\x00\x1c\xfb\x9f\xd0\x91!\x84\x89\x1bHJ\x92\xd4%\\\x00I!\x04I^\xcc\
\x81.\xe7R\xc9o=\xd7\xb9Jw\x9a\xf8t\x0f\x94R\x86\x12r\xce\x83V\xd7\x01\x03\
\x95D\x18\x17\xaf\xf7E\x00\x00\x00\x00IEND\xaeB`\x82'
示例3: len
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import registerTool [as 别名]
child = tree.AppendItem(parent, item)
if len(dict[item].keys()):
buildTree(tree, child, dict[item])
#-------------------------------------------------------------------------------
def openClassBrowser(editor):
palette = editor.palette
if not palette.browser:
wx.BeginBusyCursor()
try:
palette.browser = ClassBrowserFrame(palette)
finally:
wx.EndBusyCursor()
palette.browser.restore()
# pyclbr doesn't work without source
if not hasattr(sys, 'frozen'):
Plugins.registerTool(_('wxPython class browser'), openClassBrowser,
'Images/Shared/ClassBrowser.png')
#-------------------------------------------------------------------------------
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = ClassBrowserFrame(None)
frame.Show(True)
app.MainLoop()
示例4: ord
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import registerTool [as 别名]
""" Plugin to toggle the Error/Output window with a keybinding """
import wx
import Preferences, Utils, Plugins
from Utils import _
# only install if ErrOut is docked in the Editor
if Preferences.eoErrOutDockWindow != 'editor':
raise Plugins.SkipPluginSilently
Preferences.keyDefs['ToggleErrOut'] = (wx.ACCEL_ALT, ord('O'), 'Alt-O')
def toggleErrOutWindow(editor):
editor.tabsSplitter._OnSplitterwindowSplitterDoubleclicked(None)
Plugins.registerTool(
_('Toggle Error/Output window'), toggleErrOutWindow, key='ToggleErrOut')
示例5: refresh
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import registerTool [as 别名]
EditorHelper.imgPathFolder, self, self.bookmarks)
def refresh(self):
self.entries = []
pythonDir = os.path.dirname(sys.executable)
for pth in sys.path:
pth = os.path.abspath(pth)
shortPath = pth
if pth:
if pth[0:len(pythonDir)] == pythonDir:
shortPath = pth[len(pythonDir):]
if not shortPath:
shortPath = '<Python root>'
if (shortPath, pth) not in self.entries and os.path.isdir(pth):
self.entries.append( (shortPath, pth) )
def openList(self):
self.refresh()
res = []
for short, entry in self.entries:
res.append(self.createChildNode(short, entry))
return res
if not hasattr(sys, 'frozen'):
ExplorerNodes.register(SysPathNode, clipboard='file', controller='file', root=True)
# Hook debugger attaching to Tools menu
Plugins.registerTool(
_('Attach to debugger'), ToolsOnAttachToDebugger, 'Images/Shared/Debugger.png')
示例6: _
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import registerTool [as 别名]
else:
for path in Preferences.picExtraPaths:
if path == pyIntpPath:
break
else:
Plugins.updateRcFile('prefs.plug-ins.rc.py', 'picExtraPaths',
`Preferences.picExtraPaths+[pyIntpPath]`)
finally:
dlg.Destroy()
_('Additional locations to choose the Python Interpreter Path from.')
Plugins.registerPreference('PyInterpreterChooser', 'picExtraPaths', '[]',
['Additional locations to choose the Python '
'Interpreter Path from.'])
Plugins.registerTool(_('Python interpreter chooser'), openPyInterpChooser,
'Images/PyInterpreterChooser.png')
#-------------------------------------------------------------------------------
def getPyInterpreterChooserImgData():
return \
'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x02\
\x00\x00\x00\x90\x91h6\x00\x00\x00\x03sBIT\x08\x08\x08\xdb\xe1O\xe0\x00\x00\
\x01}IDAT(\x91uR!\x92\x1bA\x0cl\xe7\xfc\x00AC=A?\x88~\x90}\xc2\[email protected]\xff\xe0\
\xc6,p\xf3\x03\x85\x1d\xdc\x1fXf\x81\x13f\xd8a\x07\x87\x1a9`\xd6\xf69\xa9\
\xa8\x06\xa8Fj\xa9\xba\xd5\xb8\xde\xa2\x14W\x85;J\xf1\xeb\x7f""6\xd7\xeb\xf5\
t:E\x84jd\xc2\x1d$\x80RJ\xc1?\x91\x99\xdb\x91\x91T\xad\xee\xb5\xd6\xab\xfbF\
\xa4\x93\xfc\xd8*""\x02\xe0\x01\x00*\x89Z7$2\x17\x11133\x1b\r\xaa:Fl2\xb3Vw\
\x7f^\r(\x01\xa0w\xdb\xef\xe7; 3_\xc8PE\xef\x10\x01\x00*\x96\t\xed\x0b\xda/L\
\x82\xdd\xee=\x13f&"\xbdw\x92[*\xd4\x01\[email protected]\x0e\xc6\x05\x1a\xb83 \x03x\x08\
\xb0U\xf5\xf4\\k\x05\x00\xbc"\x0b\xbc"\x81[\xe5\x11\x9f\x8e\xafG*B\xa1\xe3\
示例7: SourcePseudoFile
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import registerTool [as 别名]
data = ''.join(srcLines)
eol = Utils.getEOLMode(data)
file = SourcePseudoFile(srcLines)
ri = reindent.Reindenter(file, eol=eol)
try:
if ri.run():
file.output = []
ri.write(file)
return ''.join(file.output)
except Exception, error:
print 'Error on reindenting %s : %s'%(filename, str(error))
return data
class SourcePseudoFile(Utils.PseudoFileOutStore):
def readlines(self):
return self.output
#-------------------------------------------------------------------------------
def showWx25CodeUpgradeDlg(editor):
dlg = Wx25CodeUpgradeDlg(editor, editor.getOpenFromHereDir())
try:
dlg.ShowModal()
finally:
dlg.Destroy()
import Plugins
Plugins.registerTool('wxPython 2.4 to 2.5/2.6 code upgrader', showWx25CodeUpgradeDlg)
示例8: LanguageSelectDlg
# 需要导入模块: import Plugins [as 别名]
# 或者: from Plugins import registerTool [as 别名]
app = wx.PySimpleApp()
dlg = LanguageSelectDlg(None, lang=wx.LANGUAGE_ENGLISH,
boaLangs=(wx.LANGUAGE_AFRIKAANS, wx.LANGUAGE_DEFAULT,
wx.LANGUAGE_ENGLISH, wx.LANGUAGE_SPANISH))
try:
if dlg.ShowModal() == wx.ID_OK:
print dlg.GetLanguageInfo()
finally:
dlg.Destroy()
app.MainLoop()
else:
# boa
import Preferences, About, Plugins
langs = [l for l, a in About.translations]
langs.extend([wx.LANGUAGE_ENGLISH, wx.LANGUAGE_DEFAULT])
def showChooseIDELanguage(editor):
dlg = LanguageSelectDlg(editor, lang=Preferences.i18nLanguage,
boaLangs=langs)
try:
if dlg.ShowModal() == wx.ID_OK:
lang, ident = dlg.GetLanguageInfo()
Preferences.i18nLanguage = lang
Plugins.updateRcFile('prefs.rc.py', 'i18nLanguage', 'wx.'+ident)
finally:
dlg.Destroy()
Plugins.registerTool('Choose IDE Language', showChooseIDELanguage, 'Images/Editor/LanguageSelect.png')