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-2016 Eyeo GmbH | 4 # Copyright (C) 2006-2016 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 'download': packageFile, | 374 'download': packageFile, |
375 'mtime': os.path.getmtime(os.path.join(baseDir, packageFile)), | 375 'mtime': os.path.getmtime(os.path.join(baseDir, packageFile)), |
376 'size': os.path.getsize(os.path.join(baseDir, packageFile)) | 376 'size': os.path.getsize(os.path.join(baseDir, packageFile)) |
377 } | 377 } |
378 if os.path.exists(os.path.join(baseDir, changelogFile)): | 378 if os.path.exists(os.path.join(baseDir, changelogFile)): |
379 link['changelog'] = changelogFile | 379 link['changelog'] = changelogFile |
380 links.append(link) | 380 links.append(link) |
381 template = get_template(get_config().get('extensions', 'nightlyIndexPage')) | 381 template = get_template(get_config().get('extensions', 'nightlyIndexPage')) |
382 template.stream({'config': self.config, 'links': links}).dump(outputPath) | 382 template.stream({'config': self.config, 'links': links}).dump(outputPath) |
383 | 383 |
384 def updateDocs(self): | |
385 if self.config.type not in ('gecko', 'chrome'): | |
386 return | |
387 | |
388 import buildtools.build as build | |
389 outputPath = os.path.join(self.config.docsDirectory, self.basename) | |
390 build.generateDocs(self.tempdir, None, [('--quiet', '')], [outputPath], self
.config.type) | |
391 | |
392 def uploadToMozillaAddons(self): | 384 def uploadToMozillaAddons(self): |
393 import urllib3 | 385 import urllib3 |
394 | 386 |
395 username = get_config().get('extensions', 'amo_username') | 387 username = get_config().get('extensions', 'amo_username') |
396 password = get_config().get('extensions', 'amo_password') | 388 password = get_config().get('extensions', 'amo_password') |
397 | 389 |
398 slug = self.config.galleryID | 390 slug = self.config.galleryID |
399 login_url= 'https://addons.mozilla.org/en-US/firefox/users/login' | 391 login_url= 'https://addons.mozilla.org/en-US/firefox/users/login' |
400 upload_url = 'https://addons.mozilla.org/en-US/developers/addon/%s/upload' %
slug | 392 upload_url = 'https://addons.mozilla.org/en-US/developers/addon/%s/upload' %
slug |
401 add_url = 'https://addons.mozilla.org/en-US/developers/addon/%s/versions/add
' % slug | 393 add_url = 'https://addons.mozilla.org/en-US/developers/addon/%s/versions/add
' % slug |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 # create development build | 573 # create development build |
582 self.build() | 574 self.build() |
583 | 575 |
584 # write out changelog | 576 # write out changelog |
585 self.writeChangelog(self.getChanges()) | 577 self.writeChangelog(self.getChanges()) |
586 | 578 |
587 # write update manifest | 579 # write update manifest |
588 if self.config.type != 'gecko': | 580 if self.config.type != 'gecko': |
589 self.writeUpdateManifest() | 581 self.writeUpdateManifest() |
590 | 582 |
591 # update documentation | |
592 self.updateDocs() | |
593 | |
594 # retire old builds | 583 # retire old builds |
595 versions = self.retireBuilds() | 584 versions = self.retireBuilds() |
596 | 585 |
597 if self.config.type == 'ie': | 586 if self.config.type == 'ie': |
598 self.writeIEUpdateManifest(versions) | 587 self.writeIEUpdateManifest(versions) |
599 | 588 |
600 # update index page | 589 # update index page |
601 self.updateIndex(versions) | 590 self.updateIndex(versions) |
602 | 591 |
603 # update nightlies config | 592 # update nightlies config |
(...skipping 30 matching lines...) Expand all Loading... |
634 except Exception, ex: | 623 except Exception, ex: |
635 logging.error("The build for %s failed:", repo) | 624 logging.error("The build for %s failed:", repo) |
636 logging.exception(ex) | 625 logging.exception(ex) |
637 | 626 |
638 file = open(nightlyConfigFile, 'wb') | 627 file = open(nightlyConfigFile, 'wb') |
639 nightlyConfig.write(file) | 628 nightlyConfig.write(file) |
640 | 629 |
641 | 630 |
642 if __name__ == '__main__': | 631 if __name__ == '__main__': |
643 main() | 632 main() |
OLD | NEW |