Left: | ||
Right: |
OLD | NEW |
---|---|
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This file is part of the Adblock Plus web scripts, | 3 # This file is part of the Adblock Plus web scripts, |
4 # Copyright (C) 2006-2015 Eyeo GmbH | 4 # Copyright (C) 2006-2015 Eyeo GmbH |
5 # | 5 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
9 # | 9 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 if name.startswith("./"): | 115 if name.startswith("./"): |
116 name = name[2:] | 116 name = name[2:] |
117 | 117 |
118 if fileinfo.type == tarfile.REGTYPE: | 118 if fileinfo.type == tarfile.REGTYPE: |
119 data = codecs.getreader("utf8")(archive.extractfile(fileinfo)) | 119 data = codecs.getreader("utf8")(archive.extractfile(fileinfo)) |
120 try: | 120 try: |
121 notification = _parse_notification(data, name) | 121 notification = _parse_notification(data, name) |
122 if "inactive" in notification: | 122 if "inactive" in notification: |
123 continue | 123 continue |
124 current_time = datetime.datetime.now() | 124 current_time = datetime.datetime.now() |
125 if "start" in notification and current_time < notification["start"]: | 125 if "start" in notification: |
Felix Dahlke
2015/07/29 10:45:11
Not entirely sure on how to best change this. This
Sebastian Noack
2015/07/29 11:28:54
This wouldn't be the same. With this patch you onl
Felix Dahlke
2015/07/29 14:30:17
Yeah it's fine to always remove them. I'll do it t
| |
126 continue | 126 if current_time < notification["start"]: |
127 if "end" in notification and current_time > notification["end"]: | 127 continue |
128 continue | 128 notification.pop("start", None) |
129 if "end" in notification: | |
130 if current_time > notification["end"]: | |
131 continue | |
132 notification.pop("end", None) | |
129 notifications.append(notification) | 133 notifications.append(notification) |
130 except: | 134 except: |
131 traceback.print_exc() | 135 traceback.print_exc() |
132 return notifications | 136 return notifications |
OLD | NEW |