gws.plugin.qgis.caps

QGIS project xml parser.

Source code: gws.plugin.qgis.caps

Module Contents

class gws.plugin.qgis.caps.PrintTemplateElement(*args, **kwargs)

Bases: gws.Data

Basic data object.

This object can be instantiated by passing one or or dict arguments and/or keyword args. All dicts keys and keywords become attributes of the object.

Accessing an undefined attribute returns None and no error is raised, unless the attribute name starts with an underscore.

type: str
uuid: str
attributes: dict
position: gws.UomPoint
size: gws.UomSize
class gws.plugin.qgis.caps.PrintTemplate(*args, **kwargs)

Bases: gws.Data

Basic data object.

This object can be instantiated by passing one or or dict arguments and/or keyword args. All dicts keys and keywords become attributes of the object.

Accessing an undefined attribute returns None and no error is raised, unless the attribute name starts with an underscore.

title: str
index: int
attributes: dict
elements: list[PrintTemplateElement]
class gws.plugin.qgis.caps.Caps(*args, **kwargs)

Bases: gws.Data

Basic data object.

This object can be instantiated by passing one or or dict arguments and/or keyword args. All dicts keys and keywords become attributes of the object.

Accessing an undefined attribute returns None and no error is raised, unless the attribute name starts with an underscore.

metadata: gws.Metadata
printTemplates: list[PrintTemplate]
projectBounds: gws.Bounds
properties: dict
sourceLayers: list[gws.SourceLayer]
version: str
visibilityPresets: dict[str, list[str]]
gws.plugin.qgis.caps.parse(xml: str) Caps
gws.plugin.qgis.caps.parse_element(root_el: gws.XmlElement) Caps
gws.plugin.qgis.caps.parse_datasource(prov, text)
gws.plugin.qgis.caps.parse_properties(el: gws.XmlElement)

Parse qgis property blocks.

There are following forms:

Scalar property:

<WMSContactPhone type="QString">...

Dict:

<QFieldSync>
    <dirsToCopy type="QString">...
    <exportDirectoryProject type="QString">...
</QFieldSync>

Option map:

<data-defined-properties>
    <Option type="Map">
        <Option type="QString" name="..." value="..."/>
        <Option name="properties"/>
  </Option>
</data-defined-properties>