1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
8
Include="App/Metadata.h"
9
FatherInclude="Base/PyObjectBase.h"
13
NumberProtocol="false"
15
FatherNamespace="Base">
19
<Author Licence="LGPL" Name="Chris Hennes" EMail="chennes@pioneerlibrarysystem.org" />
20
<UserDocu>App.Metadata class.
22
A Metadata object reads an XML-formatted package metadata file and provides
23
read and write access to its contents.
25
The following constructors are supported:
32
metadata : App.Metadata
35
Reads the XML file and provides access to the metadata it specifies.
40
Treats the bytes as UTF-8-encoded XML data and provides access to the metadata it specifies.
42
Python bytes-like object.</UserDocu>
43
<DeveloperDocu>Metadata</DeveloperDocu>
46
<Attribute Name="Name">
48
<UserDocu>String representing the name of this item.</UserDocu>
50
<Parameter Name="Name" Type="Object" />
52
<Attribute Name="Version">
54
<UserDocu>String representing the version of this item in semantic triplet format.</UserDocu>
56
<Parameter Name="Version" Type="Object" />
58
<Attribute Name="Date">
60
<UserDocu>String representing the date of this item in YYYY-MM-DD format (format not currently programmatically enforced)</UserDocu>
62
<Parameter Name="Date" Type="Object" />
64
<Attribute Name="Type">
66
<UserDocu>String representing the type of this item (text only, no markup allowed).</UserDocu>
68
<Parameter Name="Type" Type="Object" />
70
<Attribute Name="Description">
72
<UserDocu>String representing the description of this item (text only, no markup allowed).</UserDocu>
74
<Parameter Name="Description" Type="Object" />
76
<Attribute Name="Maintainer">
78
<UserDocu>List of maintainer objects with 'name' and 'email' string attributes.</UserDocu>
80
<Parameter Name="Maintainer" Type="Object" />
82
<Attribute Name="License">
84
<UserDocu>List of applicable licenses as objects with 'name' and 'file' string attributes.</UserDocu>
86
<Parameter Name="License" Type="Object" />
88
<Attribute Name="Urls">
90
<UserDocu>List of URLs as objects with 'location' and 'type' string attributes, where type
96
* documentation</UserDocu>
98
<Parameter Name="Urls" Type="Object" />
100
<Attribute Name="Author">
102
<UserDocu>List of author objects, each with a 'name' and a (potentially empty) 'email'
103
string attribute.</UserDocu>
105
<Parameter Name="Author" Type="Object" />
107
<Attribute Name="Depend">
109
<UserDocu>List of dependencies, as objects with the following attributes:
111
Required. Must exactly match the contents of the 'name' element in the
112
referenced package's package.xml file.
114
Optional. The dependency to the package is restricted to versions less than
115
the stated version number.
117
Optional. The dependency to the package is restricted to versions less or
118
equal than the stated version number.
120
Optional. The dependency to the package is restricted to a version equal
121
than the stated version number.
123
Optional. The dependency to the package is restricted to versions greater
124
or equal than the stated version number.
126
Optional. The dependency to the package is restricted to versions greater
127
than the stated version number.
129
Optional. Conditional expression as documented in REP149.</UserDocu>
131
<Parameter Name="Depend" Type="Object" />
133
<Attribute Name="Conflict">
135
<UserDocu>List of conflicts, format identical to dependencies.</UserDocu>
137
<Parameter Name="Conflict" Type="Object" />
139
<Attribute Name="Replace">
141
<UserDocu>List of things this item is considered by its author to replace. The format is
142
identical to dependencies.</UserDocu>
144
<Parameter Name="Replace" Type="Object" />
146
<Attribute Name="Tag">
148
<UserDocu>List of strings.</UserDocu>
150
<Parameter Name="Tag" Type="Object" />
152
<Attribute Name="Icon">
154
<UserDocu>Relative path to an icon file.</UserDocu>
156
<Parameter Name="Icon" Type="Object" />
158
<Attribute Name="Classname">
160
<UserDocu>String representing the name of the main Python class this item
161
creates/represents.</UserDocu>
163
<Parameter Name="Classname" Type="Object" />
165
<Attribute Name="Subdirectory">
167
<UserDocu>String representing the name of the subdirectory this content item is located in.
168
If empty, the item is in a directory named the same as the content item.</UserDocu>
170
<Parameter Name="Subdirectory" Type="Object" />
172
<Attribute Name="File">
174
<UserDocu>List of files associated with this item.
175
The meaning of each file is implementation-defined.</UserDocu>
177
<Parameter Name="File" Type="Object" />
179
<Attribute Name="Content">
181
<UserDocu>Dictionary of lists of content items: defined recursively, each item is itself
183
See package.xml file format documentation for details.</UserDocu>
185
<Parameter Name="Content" Type="Object" />
188
<Attribute Name="FreeCADMin">
190
<UserDocu>String representing the minimum version of FreeCAD needed for this item.
191
If unset it will be 0.0.0.</UserDocu>
193
<Parameter Name="FreeCADMin" Type="Object" />
196
<Attribute Name="FreeCADMax">
198
<UserDocu>String representing the maximum version of FreeCAD needed for this item.
199
If unset it will be 0.0.0.</UserDocu>
201
<Parameter Name="FreeCADMax" Type="Object" />
204
<Attribute Name="PythonMin">
206
<UserDocu>String representing the minimum version of Python needed for this item.
207
If unset it will be 0.0.0.</UserDocu>
209
<Parameter Name="PythonMin" Type="Object" />
212
<Methode Name="getLastSupportedFreeCADVersion">
214
<UserDocu>getLastSupportedFreeCADVersion() -> str or None
216
Search through all content package items, and determine if a maximum supported
217
version of FreeCAD is set.
218
Returns None if no maximum version is set, or if *any* content item fails to
219
provide a maximum version (implying that that content item will work with all
220
known versions).</UserDocu>
224
<Methode Name="getFirstSupportedFreeCADVersion">
226
<UserDocu>getFirstSupportedFreeCADVersion() -> str or None
228
Search through all content package items, and determine if a minimum supported
229
version of FreeCAD is set.
230
Returns 0.0 if no minimum version is set, or if *any* content item fails to
231
provide a minimum version (implying that that content item will work with all
232
known versions. Technically limited to 0.20 as the lowest known version since
233
the metadata standard was added then).</UserDocu>
237
<Methode Name="supportsCurrentFreeCAD">
239
<UserDocu>supportsCurrentFreeCAD() -> bool
241
Returns False if this metadata object directly indicates that it does not
242
support the current version of FreeCAD, or True if it makes no indication, or
243
specifically indicates that it does support the current version. Does not
244
recurse into Content items.</UserDocu>
248
<Methode Name="getGenericMetadata">
250
<UserDocu>getGenericMetadata(name) -> list
252
Get the list of GenericMetadata objects with key 'name'.
253
Generic metadata objects are Python objects with a string 'contents' and a
254
dictionary of strings, 'attributes'. They represent unrecognized simple XML tags
255
in the metadata file.</UserDocu>
259
<Methode Name="addContentItem">
261
<UserDocu>addContentItem(content_type,metadata)
263
Add a new content item of type 'content_type' with metadata 'metadata'. </UserDocu>
267
<Methode Name="removeContentItem">
269
<UserDocu>removeContentItem(content_type,name)
271
Remove the content item of type 'content_type' with name 'name'. </UserDocu>
275
<Methode Name="addMaintainer">
277
<UserDocu>addMaintainer(name, email)
279
Add a new Maintainer. </UserDocu>
283
<Methode Name="removeMaintainer">
285
<UserDocu>removeMaintainer(name, email)
287
Remove the Maintainer. </UserDocu>
291
<Methode Name="addLicense">
293
<UserDocu>addLicense(short_code,path)
295
Add a new License. </UserDocu>
299
<Methode Name="removeLicense">
301
<UserDocu>removeLicense(short_code)
303
Remove the License. </UserDocu>
307
<Methode Name="addUrl">
309
<UserDocu>addUrl(url_type,url,branch)
311
Add a new Url or type 'url_type' (which should be one of 'repository', 'readme',
313
'bugtracker', 'documentation', or 'webpage') If type is 'repository' you
315
must also specify the 'branch' parameter. </UserDocu>
319
<Methode Name="removeUrl">
321
<UserDocu>removeUrl(url_type,url)
323
Remove the Url. </UserDocu>
327
<Methode Name="addAuthor">
329
<UserDocu>addAuthor(name, email)
331
Add a new Author with name 'name', and optionally email 'email'. </UserDocu>
335
<Methode Name="removeAuthor">
337
<UserDocu>removeAuthor(name, email)
339
Remove the Author. </UserDocu>
343
<Methode Name="addDepend">
345
<UserDocu>addDepend(name, kind, optional)
347
Add a new Dependency on package 'name' of kind 'kind' (optional, one of 'auto' (the default),
349
'internal', 'addon', or 'python'). </UserDocu>
353
<Methode Name="removeDepend">
355
<UserDocu>removeDepend(name, kind)
357
Remove the Dependency on package 'name' of kind 'kind' (optional - if unspecified any
359
matching name is removed). </UserDocu>
363
<Methode Name="addConflict">
365
<UserDocu>addConflict(name, kind)
367
Add a new Conflict. See documentation for addDepend(). </UserDocu>
371
<Methode Name="removeConflict">
373
<UserDocu>removeConflict(name, kind)
375
Remove the Conflict. See documentation for removeDepend().</UserDocu>
379
<Methode Name="addReplace">
381
<UserDocu>addReplace(name)
383
Add a new Replace. </UserDocu>
387
<Methode Name="removeReplace">
389
<UserDocu>removeReplace(name)
391
Remove the Replace. </UserDocu>
395
<Methode Name="addTag">
397
<UserDocu>addTag(tag)
399
Add a new Tag. </UserDocu>
403
<Methode Name="removeTag">
405
<UserDocu>removeTag(tag)
407
Remove the Tag. </UserDocu>
411
<Methode Name="addFile">
413
<UserDocu>addFile(filename)
415
Add a new File. </UserDocu>
419
<Methode Name="removeFile">
421
<UserDocu>removeFile(filename)
423
Remove the File. </UserDocu>
427
<Methode Name="write">
429
<UserDocu>write(filename)
431
Write the metadata to the given file as XML data.</UserDocu>
437
MetadataPy(const Metadata & pla, PyTypeObject *T = &Type)
438
:PyObjectBase(new Metadata(pla),T){}
439
Metadata value() const
440
{ return *(getMetadataPtr()); }