Changeset View
Changeset View
Standalone View
Standalone View
find-modules/module_generation/PyKF5/Attica.py
- This file was added.
1 | # | ||||
---|---|---|---|---|---|
2 | # Copyright 2017 by Shaheed Haque (srhaque@theiet.org) | ||||
3 | # | ||||
4 | # This program is free software; you can redistribute it and/or modify | ||||
5 | # it under the terms of the GNU General Public License as published by | ||||
6 | # the Free Software Foundation; either version 2 of the License, or | ||||
7 | # (at your option) any later version. | ||||
8 | # | ||||
9 | # This program is distributed in the hope that it will be useful, | ||||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | # GNU General Public License for more details. | ||||
13 | # | ||||
14 | # You should have received a copy of the GNU General Public License | ||||
15 | # along with this program; if not, write to the Free Software | ||||
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||||
17 | # 02110-1301 USA. | ||||
18 | # | ||||
19 | """ | ||||
20 | SIP binding customisation for PyKF5.Attica. This modules describes: | ||||
21 | | ||||
22 | * Supplementary SIP file generator rules. | ||||
23 | """ | ||||
24 | import rule_helpers | ||||
25 | | ||||
26 | | ||||
27 | def container_fix_typename(container, sip, rule): | ||||
28 | rule_helpers.container_add_typedefs(container, sip, rule, "typename T::List") | ||||
29 | | ||||
30 | | ||||
31 | def module_fix_mapped_types(filename, sip, rule): | ||||
32 | rule_helpers.modulecode_delete(filename, sip, rule, "QList<QUrl>") | ||||
33 | rule_helpers.module_add_imports(filename, sip, rule, "Attica/attica/atticamod.sip") | ||||
34 | | ||||
35 | | ||||
36 | def container_rules(): | ||||
37 | return [ | ||||
38 | # | ||||
39 | # SIP cannot handle "typename ...". | ||||
40 | # | ||||
41 | ["Attica", "ListJob", ".*", ".*", ".*", container_fix_typename], | ||||
42 | ] | ||||
43 | | ||||
44 | | ||||
45 | def function_rules(): | ||||
46 | return [ | ||||
47 | ["Attica::DownloadDescription", "id|type|isDownloadtypLink|hasPrice|category|name|link|distributionType" | ||||
48 | "|priceReason|priceAmount|size|gpgFingerprint|gpgSignature|packageName" | ||||
49 | "|repository", ".*", ".*", ".*", ".*", "(?! const)", rule_helpers.function_discard], | ||||
50 | ["Attica::Provider", "hasCredentials", ".*", ".*", ".*", ".*", "(?! const)", rule_helpers.function_discard], | ||||
51 | ["Attica::Provider", "voteForContent", ".*", ".*", ".*bool positiveVote", rule_helpers.function_discard], | ||||
52 | ] | ||||
53 | | ||||
54 | | ||||
55 | def typedef_rules(): | ||||
56 | return [ | ||||
57 | # | ||||
58 | # SIP thinks there are duplicate signatures. | ||||
59 | # | ||||
60 | ["postjob.h", "StringMap", ".*", ".*", rule_helpers.typedef_discard], | ||||
61 | ] | ||||
62 | | ||||
63 | | ||||
64 | def modulecode(): | ||||
65 | return { | ||||
66 | "Attica/Attica/Atticamod.sip": { | ||||
67 | "code": module_fix_mapped_types, | ||||
68 | }, | ||||
69 | } |