FreeCAD

Форк
0
/
MetadataPy.xml 
443 строки · 14.9 Кб
1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
3
    <PythonExport
4
      Father="PyObjectBase"
5
      Name="MetadataPy"
6
      Twin="Metadata"
7
      TwinPointer="Metadata"
8
      Include="App/Metadata.h"
9
      FatherInclude="Base/PyObjectBase.h"
10
      Namespace="App"
11
      Constructor="true"
12
      Delete="true"
13
      NumberProtocol="false"
14
      RichCompare="false"
15
      FatherNamespace="Base">
16

17

18
        <Documentation>
19
            <Author Licence="LGPL" Name="Chris Hennes" EMail="chennes@pioneerlibrarysystem.org" />
20
            <UserDocu>App.Metadata class.
21

22
A Metadata object reads an XML-formatted package metadata file and provides
23
read and write access to its contents.
24

25
The following constructors are supported:
26

27
Metadata()
28
Empty constructor.
29

30
Metadata(metadata)
31
Copy constructor.
32
metadata : App.Metadata
33

34
Metadata(file)
35
Reads the XML file and provides access to the metadata it specifies.
36
file : str
37
    XML file name.
38

39
Metadata(bytes)
40
Treats the bytes as UTF-8-encoded XML data and provides access to the metadata it specifies.
41
bytes : bytes
42
    Python bytes-like object.</UserDocu>
43
            <DeveloperDocu>Metadata</DeveloperDocu>
44
        </Documentation>
45

46
        <Attribute Name="Name">
47
            <Documentation>
48
                <UserDocu>String representing the name of this item.</UserDocu>
49
            </Documentation>
50
            <Parameter Name="Name" Type="Object" />
51
        </Attribute>
52
        <Attribute Name="Version">
53
            <Documentation>
54
                <UserDocu>String representing the version of this item in semantic triplet format.</UserDocu>
55
            </Documentation>
56
            <Parameter Name="Version" Type="Object" />
57
        </Attribute>
58
        <Attribute Name="Date">
59
            <Documentation>
60
                <UserDocu>String representing the date of this item in YYYY-MM-DD format (format not currently programmatically enforced)</UserDocu>
61
            </Documentation>
62
            <Parameter Name="Date" Type="Object" />
63
        </Attribute>
64
        <Attribute Name="Type">
65
            <Documentation>
66
                <UserDocu>String representing the type of this item (text only, no markup allowed).</UserDocu>
67
            </Documentation>
68
            <Parameter Name="Type" Type="Object" />
69
        </Attribute>
70
        <Attribute Name="Description">
71
            <Documentation>
72
                <UserDocu>String representing the description of this item (text only, no markup allowed).</UserDocu>
73
            </Documentation>
74
            <Parameter Name="Description" Type="Object" />
75
        </Attribute>
76
        <Attribute Name="Maintainer">
77
            <Documentation>
78
                <UserDocu>List of maintainer objects with 'name' and 'email' string attributes.</UserDocu>
79
            </Documentation>
80
            <Parameter Name="Maintainer" Type="Object" />
81
        </Attribute>
82
        <Attribute Name="License">
83
            <Documentation>
84
                <UserDocu>List of applicable licenses as objects with 'name' and 'file' string attributes.</UserDocu>
85
            </Documentation>
86
            <Parameter Name="License" Type="Object" />
87
        </Attribute>
88
        <Attribute Name="Urls">
89
            <Documentation>
90
                <UserDocu>List of URLs as objects with 'location' and 'type' string attributes, where type
91
is one of:
92
* website
93
* repository
94
* bugtracker
95
* readme
96
* documentation</UserDocu>
97
            </Documentation>
98
            <Parameter Name="Urls" Type="Object" />
99
        </Attribute>
100
        <Attribute Name="Author">
101
            <Documentation>
102
                <UserDocu>List of author objects, each with a 'name' and a (potentially empty) 'email'
103
string attribute.</UserDocu>
104
            </Documentation>
105
            <Parameter Name="Author" Type="Object" />
106
        </Attribute>
107
        <Attribute Name="Depend">
108
            <Documentation>
109
                <UserDocu>List of dependencies, as objects with the following attributes:
110
* package
111
    Required. Must exactly match the contents of the 'name' element in the
112
    referenced package's package.xml file.
113
* version_lt
114
    Optional. The dependency to the package is restricted to versions less than
115
    the stated version number.
116
* version_lte
117
    Optional. The dependency to the package is restricted to versions less or
118
    equal than the stated version number.
119
* version_eq
120
    Optional. The dependency to the package is restricted to a version equal
121
    than the stated version number.
122
* version_gte
123
    Optional. The dependency to the package is restricted to versions greater
124
    or equal than the stated version number.
125
* version_gt
126
    Optional. The dependency to the package is restricted to versions greater
127
    than the stated version number.
128
* condition
129
    Optional. Conditional expression as documented in REP149.</UserDocu>
130
            </Documentation>
131
            <Parameter Name="Depend" Type="Object" />
132
        </Attribute>
133
        <Attribute Name="Conflict">
134
            <Documentation>
135
                <UserDocu>List of conflicts, format identical to dependencies.</UserDocu>
136
            </Documentation>
137
            <Parameter Name="Conflict" Type="Object" />
138
        </Attribute>
139
        <Attribute Name="Replace">
140
            <Documentation>
141
                <UserDocu>List of things this item is considered by its author to replace. The format is
142
identical to dependencies.</UserDocu>
143
            </Documentation>
144
            <Parameter Name="Replace" Type="Object" />
145
        </Attribute>
146
        <Attribute Name="Tag">
147
            <Documentation>
148
                <UserDocu>List of strings.</UserDocu>
149
            </Documentation>
150
            <Parameter Name="Tag" Type="Object" />
151
        </Attribute>
152
        <Attribute Name="Icon">
153
            <Documentation>
154
                <UserDocu>Relative path to an icon file.</UserDocu>
155
            </Documentation>
156
            <Parameter Name="Icon" Type="Object" />
157
        </Attribute>
158
        <Attribute Name="Classname">
159
            <Documentation>
160
                <UserDocu>String representing the name of the main Python class this item
161
creates/represents.</UserDocu>
162
            </Documentation>
163
            <Parameter Name="Classname" Type="Object" />
164
        </Attribute>
165
        <Attribute Name="Subdirectory">
166
            <Documentation>
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>
169
            </Documentation>
170
            <Parameter Name="Subdirectory" Type="Object" />
171
        </Attribute>
172
        <Attribute Name="File">
173
            <Documentation>
174
                <UserDocu>List of files associated with this item.
175
The meaning of each file is implementation-defined.</UserDocu>
176
            </Documentation>
177
            <Parameter Name="File" Type="Object" />
178
        </Attribute>
179
        <Attribute Name="Content">
180
            <Documentation>
181
                <UserDocu>Dictionary of lists of content items: defined recursively, each item is itself
182
a Metadata object.
183
See package.xml file format documentation for details.</UserDocu>
184
            </Documentation>
185
            <Parameter Name="Content" Type="Object" />
186
        </Attribute>
187

188
        <Attribute Name="FreeCADMin">
189
            <Documentation>
190
                <UserDocu>String representing the minimum version of FreeCAD needed for this item.
191
If unset it will be 0.0.0.</UserDocu>
192
            </Documentation>
193
            <Parameter Name="FreeCADMin" Type="Object" />
194
        </Attribute>
195

196
        <Attribute Name="FreeCADMax">
197
            <Documentation>
198
                <UserDocu>String representing the maximum version of FreeCAD needed for this item.
199
If unset it will be 0.0.0.</UserDocu>
200
            </Documentation>
201
            <Parameter Name="FreeCADMax" Type="Object" />
202
        </Attribute>
203

204
        <Attribute Name="PythonMin">
205
            <Documentation>
206
                <UserDocu>String representing the minimum version of Python needed for this item.
207
If unset it will be 0.0.0.</UserDocu>
208
            </Documentation>
209
            <Parameter Name="PythonMin" Type="Object" />
210
        </Attribute>
211

212
        <Methode Name="getLastSupportedFreeCADVersion">
213
            <Documentation>
214
                <UserDocu>getLastSupportedFreeCADVersion() -> str or None
215

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>
221
            </Documentation>
222
        </Methode>
223

224
        <Methode Name="getFirstSupportedFreeCADVersion">
225
            <Documentation>
226
                <UserDocu>getFirstSupportedFreeCADVersion() -> str or None
227

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>
234
            </Documentation>
235
        </Methode>
236

237
    <Methode Name="supportsCurrentFreeCAD">
238
      <Documentation>
239
        <UserDocu>supportsCurrentFreeCAD() -> bool
240

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>
245
      </Documentation>
246
    </Methode>
247

248
        <Methode Name="getGenericMetadata">
249
            <Documentation>
250
                <UserDocu>getGenericMetadata(name) -> list
251

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>
256
            </Documentation>
257
        </Methode>
258

259
        <Methode Name="addContentItem">
260
            <Documentation>
261
                <UserDocu>addContentItem(content_type,metadata)
262

263
Add a new content item of type 'content_type' with metadata 'metadata'. </UserDocu>
264
            </Documentation>
265
        </Methode>
266

267
        <Methode Name="removeContentItem">
268
            <Documentation>
269
                <UserDocu>removeContentItem(content_type,name)
270

271
Remove the content item of type 'content_type' with name 'name'. </UserDocu>
272
            </Documentation>
273
        </Methode>
274

275
        <Methode Name="addMaintainer">
276
            <Documentation>
277
                <UserDocu>addMaintainer(name, email)
278

279
Add a new Maintainer. </UserDocu>
280
            </Documentation>
281
        </Methode>
282

283
        <Methode Name="removeMaintainer">
284
            <Documentation>
285
                <UserDocu>removeMaintainer(name, email)
286

287
Remove the Maintainer. </UserDocu>
288
            </Documentation>
289
        </Methode>
290

291
        <Methode Name="addLicense">
292
            <Documentation>
293
                <UserDocu>addLicense(short_code,path)
294

295
Add a new License. </UserDocu>
296
            </Documentation>
297
        </Methode>
298

299
        <Methode Name="removeLicense">
300
            <Documentation>
301
                <UserDocu>removeLicense(short_code)
302

303
Remove the License. </UserDocu>
304
            </Documentation>
305
        </Methode>
306

307
        <Methode Name="addUrl">
308
            <Documentation>
309
                <UserDocu>addUrl(url_type,url,branch)
310

311
Add a new Url or type 'url_type' (which should be one of 'repository', 'readme',
312

313
'bugtracker', 'documentation', or 'webpage') If type is 'repository' you
314

315
must also specify the 'branch' parameter. </UserDocu>
316
            </Documentation>
317
        </Methode>
318

319
        <Methode Name="removeUrl">
320
            <Documentation>
321
                <UserDocu>removeUrl(url_type,url)
322

323
Remove the Url. </UserDocu>
324
            </Documentation>
325
        </Methode>
326

327
        <Methode Name="addAuthor">
328
            <Documentation>
329
                <UserDocu>addAuthor(name, email)
330

331
Add a new Author with name 'name', and optionally email 'email'. </UserDocu>
332
            </Documentation>
333
        </Methode>
334

335
        <Methode Name="removeAuthor">
336
            <Documentation>
337
                <UserDocu>removeAuthor(name, email)
338

339
Remove the Author. </UserDocu>
340
            </Documentation>
341
        </Methode>
342

343
        <Methode Name="addDepend">
344
            <Documentation>
345
                <UserDocu>addDepend(name, kind, optional)
346

347
Add a new Dependency on package 'name' of kind 'kind' (optional, one of 'auto' (the default),
348

349
'internal', 'addon', or 'python'). </UserDocu>
350
            </Documentation>
351
        </Methode>
352

353
        <Methode Name="removeDepend">
354
            <Documentation>
355
                <UserDocu>removeDepend(name, kind)
356

357
Remove the Dependency on package 'name' of kind 'kind' (optional - if unspecified any
358

359
matching name is removed). </UserDocu>
360
            </Documentation>
361
        </Methode>
362

363
        <Methode Name="addConflict">
364
            <Documentation>
365
                <UserDocu>addConflict(name, kind)
366

367
Add a new Conflict. See documentation for addDepend(). </UserDocu>
368
            </Documentation>
369
        </Methode>
370

371
        <Methode Name="removeConflict">
372
            <Documentation>
373
                <UserDocu>removeConflict(name, kind)
374

375
Remove the Conflict. See documentation for removeDepend().</UserDocu>
376
            </Documentation>
377
        </Methode>
378

379
        <Methode Name="addReplace">
380
            <Documentation>
381
                <UserDocu>addReplace(name)
382

383
Add a new Replace. </UserDocu>
384
            </Documentation>
385
        </Methode>
386

387
        <Methode Name="removeReplace">
388
            <Documentation>
389
                <UserDocu>removeReplace(name)
390

391
Remove the Replace. </UserDocu>
392
            </Documentation>
393
        </Methode>
394

395
        <Methode Name="addTag">
396
            <Documentation>
397
                <UserDocu>addTag(tag)
398

399
Add a new Tag. </UserDocu>
400
            </Documentation>
401
        </Methode>
402

403
        <Methode Name="removeTag">
404
            <Documentation>
405
                <UserDocu>removeTag(tag)
406

407
Remove the Tag. </UserDocu>
408
            </Documentation>
409
        </Methode>
410

411
        <Methode Name="addFile">
412
            <Documentation>
413
                <UserDocu>addFile(filename)
414

415
Add a new File. </UserDocu>
416
            </Documentation>
417
        </Methode>
418

419
        <Methode Name="removeFile">
420
            <Documentation>
421
                <UserDocu>removeFile(filename)
422

423
Remove the File. </UserDocu>
424
            </Documentation>
425
        </Methode>
426

427
        <Methode Name="write">
428
            <Documentation>
429
                <UserDocu>write(filename)
430

431
Write the metadata to the given file as XML data.</UserDocu>
432
            </Documentation>
433
        </Methode>
434

435
        <ClassDeclarations>
436
            public:
437
            MetadataPy(const Metadata &amp; pla, PyTypeObject *T = &amp;Type)
438
            :PyObjectBase(new Metadata(pla),T){}
439
            Metadata value() const
440
            { return *(getMetadataPtr()); }
441
        </ClassDeclarations>
442
    </PythonExport>
443
</GenerateModel>
444

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.