71 lines
2.2 KiB
Text
71 lines
2.2 KiB
Text
// Warning: Generated code! Do not edit!
|
|
// Input file: '{{inputfile}}'
|
|
// Generator: https://msdl.uantwerpen.be/git/jexelmans/xopp2py
|
|
{%- if minimal %}
|
|
// Minimal mode enabled: All XML attributes and non-text nodes are omitted.
|
|
{%- endif %}
|
|
|
|
description <{{namespaces.description}}#> as {{namespaces.shorthand}} {
|
|
|
|
uses <{{namespaces.xopp}}#> as xopp
|
|
uses <{{namespaces.object_diagram}}#> as object_diagram
|
|
{%- if not minimal %}
|
|
uses <{{namespaces.dict}}#> as dict
|
|
{%- endif %}
|
|
|
|
ci model : xopp:Model []
|
|
|
|
ci file : xopp:File [
|
|
xopp:hasCreator {{ file.creator | to_oml_string_literal }}
|
|
xopp:hasFileVersion {{ file.fileversion }}
|
|
xopp:hasTitle {{ file.title | to_oml_string_literal }}
|
|
{%- if file.preview != None %}
|
|
xopp:hasPreview {{ file.preview | to_base64_string }}
|
|
{%- endif %}
|
|
object_diagram:inModel model
|
|
]
|
|
|
|
{%- for page_index, page in enumerate(file.pages) %}
|
|
|
|
ci p{{page_index}} : xopp:Page [
|
|
xopp:hasWidth {{ page.width }}
|
|
xopp:hasHeight {{ page.height }}
|
|
xopp:hasBackgroundType {{ page.background_type | to_oml_string_literal }}
|
|
xopp:hasBackgroundColor {{ page.background_color | to_oml_string_literal }}
|
|
xopp:hasBackgroundStyle {{ page.background_style | to_oml_string_literal }}
|
|
xopp:inFile file
|
|
object_diagram:inModel model
|
|
]
|
|
|
|
{%- for layer_index, layer in enumerate(page.layers) %}
|
|
|
|
ci p{{page_index}}l{{layer_index}} : xopp:Layer [
|
|
xopp:inPage p{{page_index}}
|
|
object_diagram:inModel model
|
|
]
|
|
|
|
{%- for el_index, el in enumerate(layer.elements) %}
|
|
{%- if not minimal or el.__class__.__name__ == "Text" %}
|
|
|
|
ci p{{page_index}}l{{layer_index}}e{{el_index}} : xopp:{{el.__class__.__name__}} [
|
|
xopp:hasText {{el.text | to_oml_string_literal}}
|
|
xopp:inLayer p{{page_index}}l{{layer_index}}
|
|
object_diagram:inModel model
|
|
]
|
|
|
|
{%- if not minimal %}
|
|
{%- for key, value in el.attributes.items() %}
|
|
|
|
ci p{{page_index}}l{{layer_index}}e{{el_index}}a{{loop.index}} : xopp:XMLAttribute [
|
|
dict:hasKey {{key | to_oml_string_literal}}
|
|
dict:hasValue {{value | to_oml_string_literal}}
|
|
xopp:ofLayerElement p{{page_index}}l{{layer_index}}e{{el_index}}
|
|
object_diagram:inModel model
|
|
]
|
|
{%- endfor %}
|
|
{%- endif %}
|
|
{%- endif %}
|
|
{%- endfor %}
|
|
{%- endfor %}
|
|
{%- endfor %}
|
|
}
|