WizardDataUriEncoder/DataUriEncoderWizardDialog.py

changeset 39
3efaeaf599b6
parent 35
20bea809ae09
child 40
6051c7f094b8
equal deleted inserted replaced
38:6f0a0b48e80b 39:3efaeaf599b6
149 mimetype if self.dataCheckBox.isChecked() else '', 149 mimetype if self.dataCheckBox.isChecked() else '',
150 ';charset=utf-8;base64,' if self.dataCheckBox.isChecked() 150 ';charset=utf-8;base64,' if self.dataCheckBox.isChecked()
151 else '', 151 else '',
152 base64.b64encode(open(filepath, "rb").read()).decode() 152 base64.b64encode(open(filepath, "rb").read()).decode()
153 ) 153 )
154 except (IOError, OSError) as err: 154 except OSError as err:
155 E5MessageBox.critical( 155 E5MessageBox.critical(
156 self, 156 self,
157 self.tr("Data URI Encoder"), 157 self.tr("Data URI Encoder"),
158 self.tr( 158 self.tr(
159 """<p>The file <b>{0}</b> could not be read.</p>""" 159 """<p>The file <b>{0}</b> could not be read.</p>"""

eric ide

mercurial