Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: filters/parse_interface.py

Issue 5636796054503424: Issue 1170 - [adblockplus.org Anwiki to CMS migration] Migrate content (Closed)
Left Patch Set: Addressed snoack's comments. Created Feb. 27, 2015, 2:20 p.m.
Right Patch Set: Remove includes/common.tmpl which is no longer required. Created March 7, 2015, 7:01 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « filters/get_subscriptions.py ('k') | filters/subscription_sort.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
LEFTRIGHT

Powered by Google App Engine
This is Rietveld