| 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 links.append(link) | 419 links.append(link) |
| 420 template = get_template(get_config().get('extensions', 'nightlyIndexPage
')) | 420 template = get_template(get_config().get('extensions', 'nightlyIndexPage
')) |
| 421 template.stream({'config': self.config, 'links': links}).dump(outputPath
) | 421 template.stream({'config': self.config, 'links': links}).dump(outputPath
) |
| 422 | 422 |
| 423 def read_downloads_lockfile(self): | 423 def read_downloads_lockfile(self): |
| 424 path = get_config().get('extensions', 'downloadLockFile') | 424 path = get_config().get('extensions', 'downloadLockFile') |
| 425 try: | 425 try: |
| 426 with open(path, 'r') as fp: | 426 with open(path, 'r') as fp: |
| 427 current = json.load(fp) | 427 current = json.load(fp) |
| 428 except IOError: | 428 except IOError: |
| 429 logging.debug('No lockfile found. Creating ' + path) | 429 logging.debug('No lockfile found at ' + path) |
| 430 current = {} | 430 current = {} |
| 431 | 431 |
| 432 return current | 432 return current |
| 433 | 433 |
| 434 def write_downloads_lockfile(self, values): | 434 def write_downloads_lockfile(self, values): |
| 435 path = get_config().get('extensions', 'downloadLockFile') | 435 path = get_config().get('extensions', 'downloadLockFile') |
| 436 with open(path, 'w') as fp: | 436 with open(path, 'w') as fp: |
| 437 json.dump(values, fp) | 437 json.dump(values, fp) |
| 438 | 438 |
| 439 def add_to_downloads_lockfile(self, platform, values): | 439 def add_to_downloads_lockfile(self, platform, values): |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 | 879 |
| 880 file = open(nightlyConfigFile, 'wb') | 880 file = open(nightlyConfigFile, 'wb') |
| 881 nightlyConfig.write(file) | 881 nightlyConfig.write(file) |
| 882 | 882 |
| 883 | 883 |
| 884 if __name__ == '__main__': | 884 if __name__ == '__main__': |
| 885 parser = argparse.ArgumentParser() | 885 parser = argparse.ArgumentParser() |
| 886 parser.add_argument('--download', action='store_true', default=False) | 886 parser.add_argument('--download', action='store_true', default=False) |
| 887 args = parser.parse_args() | 887 args = parser.parse_args() |
| 888 main(args.download) | 888 main(args.download) |
| LEFT | RIGHT |