|
| 1 | +########################### |
| 2 | +Content type constant names |
| 3 | +########################### |
| 4 | + |
| 5 | +The following names are defined in the :mod:`opc.constants` module to allow |
| 6 | +content types to be referenced using an identifier rather than a literal |
| 7 | +value. |
| 8 | + |
| 9 | +The following import statement makes these available in a module:: |
| 10 | + |
| 11 | + from opc.constants import CONTENT_TYPE as CT |
| 12 | + |
| 13 | +A content type may then be referenced as a member of ``CT`` using dotted |
| 14 | +notation, for example:: |
| 15 | + |
| 16 | + part.content_type = CT.PML_SLIDE_LAYOUT |
| 17 | + |
| 18 | +The content type names are determined by transforming the trailing text of |
| 19 | +the content type string to upper snake case, replacing illegal Python |
| 20 | +identifier characters (dash and period) with an underscore, and prefixing one |
| 21 | +of these seven namespace abbreviations: |
| 22 | + |
| 23 | +* **DML** -- DrawingML |
| 24 | +* **OFC** -- Microsoft Office document |
| 25 | +* **OPC** -- Open Packaging Convention |
| 26 | +* **PML** -- PresentationML |
| 27 | +* **SML** -- SpreadsheetML |
| 28 | +* **WML** -- WordprocessingML |
| 29 | +* no prefix -- standard MIME types, such as those used for image formats like |
| 30 | + JPEG |
| 31 | + |
| 32 | +BMP |
| 33 | + image/bmp |
| 34 | + |
| 35 | +DML_CHART |
| 36 | + application/vnd.openxmlformats-officedocument.drawingml.chart+xml |
| 37 | + |
| 38 | +DML_CHARTSHAPES |
| 39 | + application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml |
| 40 | + |
| 41 | +DML_DIAGRAM_COLORS |
| 42 | + application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml |
| 43 | + |
| 44 | +DML_DIAGRAM_DATA |
| 45 | + application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml |
| 46 | + |
| 47 | +DML_DIAGRAM_LAYOUT |
| 48 | + application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml |
| 49 | + |
| 50 | +DML_DIAGRAM_STYLE |
| 51 | + application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml |
| 52 | + |
| 53 | +GIF |
| 54 | + image/gif |
| 55 | + |
| 56 | +JPEG |
| 57 | + image/jpeg |
| 58 | + |
| 59 | +MS_PHOTO |
| 60 | + image/vnd.ms-photo |
| 61 | + |
| 62 | +OFC_CUSTOM_PROPERTIES |
| 63 | + application/vnd.openxmlformats-officedocument.custom-properties+xml |
| 64 | + |
| 65 | +OFC_CUSTOM_XML_PROPERTIES |
| 66 | + application/vnd.openxmlformats-officedocument.customXmlProperties+xml |
| 67 | + |
| 68 | +OFC_DRAWING |
| 69 | + application/vnd.openxmlformats-officedocument.drawing+xml |
| 70 | + |
| 71 | +OFC_EXTENDED_PROPERTIES |
| 72 | + application/vnd.openxmlformats-officedocument.extended-properties+xml |
| 73 | + |
| 74 | +OFC_OLE_OBJECT |
| 75 | + application/vnd.openxmlformats-officedocument.oleObject |
| 76 | + |
| 77 | +OFC_PACKAGE |
| 78 | + application/vnd.openxmlformats-officedocument.package |
| 79 | + |
| 80 | +OFC_THEME |
| 81 | + application/vnd.openxmlformats-officedocument.theme+xml |
| 82 | + |
| 83 | +OFC_THEME_OVERRIDE |
| 84 | + application/vnd.openxmlformats-officedocument.themeOverride+xml |
| 85 | + |
| 86 | +OFC_VML_DRAWING |
| 87 | + application/vnd.openxmlformats-officedocument.vmlDrawing |
| 88 | + |
| 89 | +OPC_CORE_PROPERTIES |
| 90 | + application/vnd.openxmlformats-package.core-properties+xml |
| 91 | + |
| 92 | +OPC_DIGITAL_SIGNATURE_CERTIFICATE |
| 93 | + application/vnd.openxmlformats-package.digital-signature-certificate |
| 94 | + |
| 95 | +OPC_DIGITAL_SIGNATURE_ORIGIN |
| 96 | + application/vnd.openxmlformats-package.digital-signature-origin |
| 97 | + |
| 98 | +OPC_DIGITAL_SIGNATURE_XMLSIGNATURE |
| 99 | + application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml |
| 100 | + |
| 101 | +OPC_RELATIONSHIPS |
| 102 | + application/vnd.openxmlformats-package.relationships+xml |
| 103 | + |
| 104 | +PML_COMMENTS |
| 105 | + application/vnd.openxmlformats-officedocument.presentationml.comments+xml |
| 106 | + |
| 107 | +PML_COMMENT_AUTHORS |
| 108 | + application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml |
| 109 | + |
| 110 | +PML_HANDOUT_MASTER |
| 111 | + application/vnd.openxmlformats-officedocument.presentationml.handoutMaster+xml |
| 112 | + |
| 113 | +PML_NOTES_MASTER |
| 114 | + application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml |
| 115 | + |
| 116 | +PML_NOTES_SLIDE |
| 117 | + application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml |
| 118 | + |
| 119 | +PML_PRESENTATION_MAIN |
| 120 | + application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml |
| 121 | + |
| 122 | +PML_PRES_PROPS |
| 123 | + application/vnd.openxmlformats-officedocument.presentationml.presProps+xml |
| 124 | + |
| 125 | +PML_PRINTER_SETTINGS |
| 126 | + application/vnd.openxmlformats-officedocument.presentationml.printerSettings |
| 127 | + |
| 128 | +PML_SLIDE |
| 129 | + application/vnd.openxmlformats-officedocument.presentationml.slide+xml |
| 130 | + |
| 131 | +PML_SLIDESHOW_MAIN |
| 132 | + application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml |
| 133 | + |
| 134 | +PML_SLIDE_LAYOUT |
| 135 | + application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml |
| 136 | + |
| 137 | +PML_SLIDE_MASTER |
| 138 | + application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml |
| 139 | + |
| 140 | +PML_SLIDE_UPDATE_INFO |
| 141 | + application/vnd.openxmlformats-officedocument.presentationml.slideUpdateInfo+xml |
| 142 | + |
| 143 | +PML_TABLE_STYLES |
| 144 | + application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml |
| 145 | + |
| 146 | +PML_TAGS |
| 147 | + application/vnd.openxmlformats-officedocument.presentationml.tags+xml |
| 148 | + |
| 149 | +PML_TEMPLATE_MAIN |
| 150 | + application/vnd.openxmlformats-officedocument.presentationml.template.main+xml |
| 151 | + |
| 152 | +PML_VIEW_PROPS |
| 153 | + application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml |
| 154 | + |
| 155 | +PNG |
| 156 | + image/png |
| 157 | + |
| 158 | +SML_CALC_CHAIN |
| 159 | + application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml |
| 160 | + |
| 161 | +SML_CHARTSHEET |
| 162 | + application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml |
| 163 | + |
| 164 | +SML_COMMENTS |
| 165 | + application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml |
| 166 | + |
| 167 | +SML_CONNECTIONS |
| 168 | + application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml |
| 169 | + |
| 170 | +SML_CUSTOM_PROPERTY |
| 171 | + application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty |
| 172 | + |
| 173 | +SML_DIALOGSHEET |
| 174 | + application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml |
| 175 | + |
| 176 | +SML_EXTERNAL_LINK |
| 177 | + application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml |
| 178 | + |
| 179 | +SML_PIVOT_CACHE_DEFINITION |
| 180 | + application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml |
| 181 | + |
| 182 | +SML_PIVOT_CACHE_RECORDS |
| 183 | + application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml |
| 184 | + |
| 185 | +SML_PIVOT_TABLE |
| 186 | + application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml |
| 187 | + |
| 188 | +SML_PRINTER_SETTINGS |
| 189 | + application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings |
| 190 | + |
| 191 | +SML_QUERY_TABLE |
| 192 | + application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml |
| 193 | + |
| 194 | +SML_REVISION_HEADERS |
| 195 | + application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml |
| 196 | + |
| 197 | +SML_REVISION_LOG |
| 198 | + application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml |
| 199 | + |
| 200 | +SML_SHARED_STRINGS |
| 201 | + application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml |
| 202 | + |
| 203 | +SML_SHEET |
| 204 | + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| 205 | + |
| 206 | +SML_SHEET_METADATA |
| 207 | + application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml |
| 208 | + |
| 209 | +SML_STYLES |
| 210 | + application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml |
| 211 | + |
| 212 | +SML_TABLE |
| 213 | + application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml |
| 214 | + |
| 215 | +SML_TABLE_SINGLE_CELLS |
| 216 | + application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml |
| 217 | + |
| 218 | +SML_USER_NAMES |
| 219 | + application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml |
| 220 | + |
| 221 | +SML_VOLATILE_DEPENDENCIES |
| 222 | + application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml |
| 223 | + |
| 224 | +SML_WORKSHEET |
| 225 | + application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml |
| 226 | + |
| 227 | +TIFF |
| 228 | + image/tiff |
| 229 | + |
| 230 | +WML_COMMENTS |
| 231 | + application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml |
| 232 | + |
| 233 | +WML_DOCUMENT_GLOSSARY |
| 234 | + application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml |
| 235 | + |
| 236 | +WML_DOCUMENT_MAIN |
| 237 | + application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml |
| 238 | + |
| 239 | +WML_ENDNOTES |
| 240 | + application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml |
| 241 | + |
| 242 | +WML_FONT_TABLE |
| 243 | + application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml |
| 244 | + |
| 245 | +WML_FOOTER |
| 246 | + application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml |
| 247 | + |
| 248 | +WML_FOOTNOTES |
| 249 | + application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml |
| 250 | + |
| 251 | +WML_HEADER |
| 252 | + application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml |
| 253 | + |
| 254 | +WML_NUMBERING |
| 255 | + application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml |
| 256 | + |
| 257 | +WML_PRINTER_SETTINGS |
| 258 | + application/vnd.openxmlformats-officedocument.wordprocessingml.printerSettings |
| 259 | + |
| 260 | +WML_SETTINGS |
| 261 | + application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml |
| 262 | + |
| 263 | +WML_STYLES |
| 264 | + application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml |
| 265 | + |
| 266 | +WML_WEB_SETTINGS |
| 267 | + application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml |
| 268 | + |
| 269 | +XML |
| 270 | + application/xml |
| 271 | + |
| 272 | +X_EMF |
| 273 | + image/x-emf |
| 274 | + |
| 275 | +X_FONTDATA |
| 276 | + application/x-fontdata |
| 277 | + |
| 278 | +X_FONT_TTF |
| 279 | + application/x-font-ttf |
| 280 | + |
| 281 | +X_WMF |
| 282 | + image/x-wmf |
0 commit comments