Plugins/PluginWizardPyRegExp.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3345
071afe8be2a1
child 3523
8df1ab89e261
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
19 # Start-Of-Header 19 # Start-Of-Header
20 name = "Python re Wizard Plugin" 20 name = "Python re Wizard Plugin"
21 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 21 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
22 autoactivate = True 22 autoactivate = True
23 deactivateable = True 23 deactivateable = True
24 version = "5.4.0" 24 version = "5.5.0"
25 className = "PyRegExpWizard" 25 className = "PyRegExpWizard"
26 packageName = "__core__" 26 packageName = "__core__"
27 shortDescription = "Show the Python re wizard." 27 shortDescription = "Show the Python re wizard."
28 longDescription = """This plugin shows the Python re wizard.""" 28 longDescription = """This plugin shows the Python re wizard."""
29 pyqtApi = 2 29 pyqtApi = 2
68 def __initAction(self): 68 def __initAction(self):
69 """ 69 """
70 Private method to initialize the action. 70 Private method to initialize the action.
71 """ 71 """
72 self.action = E5Action( 72 self.action = E5Action(
73 self.trUtf8('Python re Wizard'), 73 self.tr('Python re Wizard'),
74 self.trUtf8('&Python re Wizard...'), 0, 0, self, 74 self.tr('&Python re Wizard...'), 0, 0, self,
75 'wizards_python_re') 75 'wizards_python_re')
76 self.action.setStatusTip(self.trUtf8('Python re Wizard')) 76 self.action.setStatusTip(self.tr('Python re Wizard'))
77 self.action.setWhatsThis(self.trUtf8( 77 self.action.setWhatsThis(self.tr(
78 """<b>Python re Wizard</b>""" 78 """<b>Python re Wizard</b>"""
79 """<p>This wizard opens a dialog for entering all the parameters""" 79 """<p>This wizard opens a dialog for entering all the parameters"""
80 """ needed to create a Python re string. The generated code is""" 80 """ needed to create a Python re string. The generated code is"""
81 """ inserted at the current cursor position.</p>""" 81 """ inserted at the current cursor position.</p>"""
82 )) 82 ))
83 self.action.triggered[()].connect(self.__handle) 83 self.action.triggered.connect(self.__handle)
84 84
85 self.__ui.addE5Actions([self.action], 'wizards') 85 self.__ui.addE5Actions([self.action], 'wizards')
86 86
87 def __initMenu(self): 87 def __initMenu(self):
88 """ 88 """
120 editor = e5App().getObject("ViewManager").activeWindow() 120 editor = e5App().getObject("ViewManager").activeWindow()
121 121
122 if editor is None: 122 if editor is None:
123 E5MessageBox.critical( 123 E5MessageBox.critical(
124 self.__ui, 124 self.__ui,
125 self.trUtf8('No current editor'), 125 self.tr('No current editor'),
126 self.trUtf8('Please open or create a file first.')) 126 self.tr('Please open or create a file first.'))
127 else: 127 else:
128 code, ok = self.__callForm(editor) 128 code, ok = self.__callForm(editor)
129 if ok: 129 if ok:
130 line, index = editor.getCursorPosition() 130 line, index = editor.getCursorPosition()
131 # It should be done on this way to allow undo 131 # It should be done on this way to allow undo

eric ide

mercurial