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

Delta Between Two Patch Sets: abp/filters/parser.py

Issue 29873561: Issue 6920 - Only parse metadata from the top of the file (Closed)
Left Patch Set: Documented behavior for parse_line(), simplified end-of-metadata semantics Created Sept. 4, 2018, 6:26 p.m.
Right Patch Set: Test 'Last modified' case Created Sept. 5, 2018, 9:09 a.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 | « no previous file | tests/test_parser.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 Adblock Plus <https://adblockplus.org/>, 1 # This file is part of Adblock Plus <https://adblockplus.org/>,
2 # Copyright (C) 2006-present eyeo GmbH 2 # Copyright (C) 2006-present 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 # filter list. Checksums are no longer used by Adblock Plus, 328 # filter list. Checksums are no longer used by Adblock Plus,
329 # but in order to strip them (in abp.filters.renderer), 329 # but in order to strip them (in abp.filters.renderer),
330 # we have to make sure to still parse them regardless of 330 # we have to make sure to still parse them regardless of
331 # their position in the filter list. 331 # their position in the filter list.
332 if not metadata_closed or key.lower() == 'checksum': 332 if not metadata_closed or key.lower() == 'checksum':
333 yield Metadata(key, value) 333 yield Metadata(key, value)
334 continue 334 continue
335 335
336 if not result.text: 336 if not result.text:
337 metadata_closed = True 337 metadata_closed = True
338 elif isinstance(result, (EmptyLine, Filter)): 338 elif not isinstance(result, Header):
Vasily Kuznetsov 2018/09/04 19:50:56 I just thought that since this could also be used
Sebastian Noack 2018/09/04 20:23:32 Done.
339 metadata_closed = True 339 metadata_closed = True
340 340
341 yield result 341 yield result
LEFTRIGHT

Powered by Google App Engine
This is Rietveld