WizardDataUriEncoder/DataUriEncoderWizardDialog.py

branch
eric7
changeset 48
d9cd58b1e0c8
parent 47
2d49cd593939
child 50
4d34c264a71d
equal deleted inserted replaced
47:2d49cd593939 48:d9cd58b1e0c8
56 56
57 "JavaScript": "var embedded_file = window.atob({0}); ", 57 "JavaScript": "var embedded_file = window.atob({0}); ",
58 58
59 "QML": "Image {{ source: {0} }} " 59 "QML": "Image {{ source: {0} }} "
60 } 60 }
61
61 62
62 class DataUriEncoderWizardDialog(QDialog, Ui_DataUriEncoderWizardDialog): 63 class DataUriEncoderWizardDialog(QDialog, Ui_DataUriEncoderWizardDialog):
63 """ 64 """
64 Class implementing the base64 data URI encoder wizard dialog. 65 Class implementing the base64 data URI encoder wizard dialog.
65 """ 66 """
205 Private method to get the mime type from the user. 206 Private method to get the mime type from the user.
206 207
207 @return entered mime type 208 @return entered mime type
208 @rtype str 209 @rtype str
209 """ 210 """
210 mimetypesList = [""] + list(sorted( 211 mimetypesList = [""] + sorted(
211 set(mimetypes.types_map.values()).union( 212 set(mimetypes.types_map.values()).union(
212 set(mimetypes.common_types.values())))) 213 set(mimetypes.common_types.values())))
213 try: 214 try:
214 index = mimetypesList.index("application/octet-stream") 215 index = mimetypesList.index("application/octet-stream")
215 except ValueError: 216 except ValueError:
216 index = 0 217 index = 0
217 mimetype, ok = QInputDialog.getItem( 218 mimetype, ok = QInputDialog.getItem(

eric ide

mercurial