LEFT | RIGHT |
1 # This file is part of the Adblock Plus website, | 1 # This file is part of the Adblock Plus website, |
2 # Copyright (C) 2006-2015 Eyeo GmbH | 2 # Copyright (C) 2006-2015 Eyeo GmbH |
3 # | 3 # |
4 # Adblock Plus is free software: you can redistribute it and/or modify | 4 # Adblock Plus is free software: you can redistribute it and/or modify |
5 # it under the terms of the GNU General Public License version 3 as | 5 # it under the terms of the GNU General Public License version 3 as |
6 # published by the Free Software Foundation. | 6 # published by the Free Software Foundation. |
7 # | 7 # |
8 # Adblock Plus is distributed in the hope that it will be useful, | 8 # Adblock Plus is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
(...skipping 22 matching lines...) Expand all Loading... |
33 if argument.strip(): | 33 if argument.strip(): |
34 match = re.match(r"^\s*(%s)\s+(\S+)\s*$" % TYPE_REGEXP, argument) | 34 match = re.match(r"^\s*(%s)\s+(\S+)\s*$" % TYPE_REGEXP, argument) |
35 if not match: | 35 if not match: |
36 warnings.warn("Skipped malformed argument: '%s'" % argument) | 36 warnings.warn("Skipped malformed argument: '%s'" % argument) |
37 continue | 37 continue |
38 argument_type, argument_name = match.groups() | 38 argument_type, argument_name = match.groups() |
39 arguments.append({ | 39 arguments.append({ |
40 "name": argument_name, | 40 "name": argument_name, |
41 "type": argument_type | 41 "type": argument_type |
42 }) | 42 }) |
43 parsed.append({ | 43 value.update({ |
44 "type": "method", | 44 "type": "method", |
45 "name": property_name, | 45 "name": property_name, |
46 "version": value.get("version", ""), | |
47 "return_type": return_type, | 46 "return_type": return_type, |
48 "arguments": arguments | 47 "arguments": arguments |
49 }) | 48 }) |
| 49 parsed.append(value) |
50 else: | 50 else: |
51 # Item is a property | 51 # Item is a property |
52 match = re.match(r"^\s*(readonly\s+)?(%s)\s+(\S+)\s*$" % TYPE_REGEXP, key) | 52 match = re.match(r"^\s*(readonly\s+)?(%s)\s+(\S+)\s*$" % TYPE_REGEXP, key) |
53 if not match: | 53 if not match: |
54 warnings.warn("Skipped malformed property: '%s'" % key) | 54 warnings.warn("Skipped malformed property: '%s'" % key) |
55 continue | 55 continue |
56 property_modifier, property_type, property_name = match.groups() | 56 property_modifier, property_type, property_name = match.groups() |
57 parsed.append({ | 57 value.update({ |
58 "type": property_type, | 58 "type": property_type, |
59 "name": property_name, | 59 "name": property_name, |
60 "modifier": property_modifier or "" | 60 "modifier": property_modifier or "" |
61 }) | 61 }) |
| 62 parsed.append(value) |
62 parsed.sort(key=lambda x: x["name"]) | 63 parsed.sort(key=lambda x: x["name"]) |
63 return parsed | 64 return parsed |
LEFT | RIGHT |