PluginWizardDataUriEncoder.py

changeset 35
20bea809ae09
parent 34
525dc29b6a22
child 37
833c3ea0ca93
equal deleted inserted replaced
34:525dc29b6a22 35:20bea809ae09
4 # 4 #
5 5
6 """ 6 """
7 Module implementing the base64 data URI encoder wizard plug-in. 7 Module implementing the base64 data URI encoder wizard plug-in.
8 """ 8 """
9
10 from __future__ import unicode_literals
11 9
12 import os 10 import os
13 11
14 from PyQt5.QtCore import QObject, QTranslator 12 from PyQt5.QtCore import QObject, QTranslator
15 from PyQt5.QtWidgets import QDialog 13 from PyQt5.QtWidgets import QDialog
21 # Start-of-Header 19 # Start-of-Header
22 name = "Base64 Data URI Encoder Wizard Plug-in" 20 name = "Base64 Data URI Encoder Wizard Plug-in"
23 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 21 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
24 autoactivate = True 22 autoactivate = True
25 deactivateable = True 23 deactivateable = True
26 version = "2.0.4" 24 version = "3.0.0"
27 className = "WizardDataUriEncoderPlugin" 25 className = "WizardDataUriEncoderPlugin"
28 packageName = "WizardDataUriEncoder" 26 packageName = "WizardDataUriEncoder"
29 shortDescription = "Wizard for the creation of code for a base64 data URI." 27 shortDescription = "Wizard for the creation of code for a base64 data URI."
30 longDescription = \ 28 longDescription = (
31 """This plug-in implements a wizard to generate code for""" \ 29 """This plug-in implements a wizard to generate code for"""
32 """ base64 encoded data URIs.""" 30 """ base64 encoded data URIs."""
31 )
33 needsRestart = False 32 needsRestart = False
34 pyqtApi = 2 33 pyqtApi = 2
35 python2Compatible = True
36 # End-of-Header 34 # End-of-Header
37 35
38 error = "" 36 error = ""
39 37
40 38
134 Private method to handle the wizards action. 132 Private method to handle the wizards action.
135 """ 133 """
136 editor = e5App().getObject("ViewManager").activeWindow() 134 editor = e5App().getObject("ViewManager").activeWindow()
137 135
138 if editor is None: 136 if editor is None:
139 E5MessageBox.critical( 137 E5MessageBox.critical(
140 self.__ui, 138 self.__ui,
141 self.tr('No current editor'), 139 self.tr('No current editor'),
142 self.tr('Please open or create a file first.')) 140 self.tr('Please open or create a file first.'))
143 else: 141 else:
144 from WizardDataUriEncoder.DataUriEncoderWizardDialog import \ 142 from WizardDataUriEncoder.DataUriEncoderWizardDialog import (
145 DataUriEncoderWizardDialog 143 DataUriEncoderWizardDialog
144 )
146 dlg = DataUriEncoderWizardDialog(None) 145 dlg = DataUriEncoderWizardDialog(None)
147 if dlg.exec_() == QDialog.Accepted: 146 if dlg.exec_() == QDialog.Accepted:
148 code = dlg.getCode() 147 code = dlg.getCode()
149 if code: 148 if code:
150 line, index = editor.getCursorPosition() 149 line, index = editor.getCursorPosition()

eric ide

mercurial