Changeset View
Changeset View
Standalone View
Standalone View
find-modules/module_generation/PyKF5/KLDAP.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.KLDAP. This modules describes: | ||||
21 | | ||||
22 | * Supplementary SIP file generator rules. | ||||
23 | """ | ||||
24 | | ||||
25 | import rule_helpers | ||||
26 | | ||||
27 | | ||||
28 | def variable_customise(container, variable, sip, matcher): | ||||
29 | sip["code"] = """ | ||||
30 | { | ||||
31 | %GetCode | ||||
32 | #include <KLDAP/kldap/ldapoperation.h> | ||||
33 | %End | ||||
34 | %SetCode | ||||
35 | #include <KLDAP/kldap/ldapoperation.h> | ||||
36 | %End | ||||
37 | }""" | ||||
38 | | ||||
39 | | ||||
40 | def module_fix_mapped_types(filename, sip, entry): | ||||
41 | rule_helpers.modulecode_make_local(filename, sip, entry, "QList<QByteArray>", "QList<QModelIndex>") | ||||
42 | | ||||
43 | | ||||
44 | def function_rules(): | ||||
45 | return [ | ||||
46 | ["KLDAP::LdapOperation", "bind|bind_s", ".*", ".*", ".*", rule_helpers.function_discard], | ||||
47 | ["KLDAP::LdapUrl", "extension", ".*", "QString", ".*", rule_helpers.function_discard], | ||||
48 | ] | ||||
49 | | ||||
50 | | ||||
51 | def variable_rules(): | ||||
52 | return [ | ||||
53 | ["KLDAP::LdapOperation.*", "proc", "SASL_Callback_Proc.*", variable_customise], | ||||
54 | ] | ||||
55 | | ||||
56 | | ||||
57 | def modulecode(): | ||||
58 | return { | ||||
59 | "KLDAP/KLDAP/KLDAPmod.sip": { | ||||
60 | "code": module_fix_mapped_types, | ||||
61 | }, | ||||
62 | } |