Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 # This file is part of the Adblock Plus web scripts, | 1 # This file is part of the Adblock Plus web scripts, |
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 return self | 228 return self |
229 | 229 |
230 def __exit__(self, type, value, traceback): | 230 def __exit__(self, type, value, traceback): |
231 return False | 231 return False |
232 | 232 |
233 def close(self): | 233 def close(self): |
234 pass | 234 pass |
235 | 235 |
236 @property | 236 @property |
237 def version(self): | 237 def version(self): |
238 return randint(1, 10) | 238 return randint(1, 2 ** 32) |
mathias
2018/06/13 06:04:50
I think this should be a way higher range. The lik
Vasily Kuznetsov
2018/06/13 13:35:23
Yeah, a range of 10 is too small. This would give
Jon Sonesen
2018/06/14 19:24:14
My bad, meant to increase the size here, it was ju
| |
239 | 239 |
240 def get_path(self, filename): | 240 def get_path(self, filename): |
241 return os.path.join(self._dir, *filename.split('/')) | 241 return os.path.join(self._dir, *filename.split('/')) |
242 | 242 |
243 def has_file(self, filename): | 243 def has_file(self, filename): |
244 return os.path.isfile(self.get_path(filename)) | 244 return os.path.isfile(self.get_path(filename)) |
245 | 245 |
246 def read_file(self, filename, binary=False): | 246 def read_file(self, filename, binary=False): |
247 path = self.get_path(filename) | 247 path = self.get_path(filename) |
248 | 248 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 'resolve_link', | 397 'resolve_link', |
398 'read_config', | 398 'read_config', |
399 'read_template', | 399 'read_template', |
400 'read_locale', | 400 'read_locale', |
401 'read_include', | 401 'read_include', |
402 'exec_file', | 402 'exec_file', |
403 ]: | 403 ]: |
404 setattr(source, fname, _memoize(getattr(source, fname))) | 404 setattr(source, fname, _memoize(getattr(source, fname))) |
405 | 405 |
406 return source | 406 return source |
LEFT | RIGHT |