| OLD | NEW |
| 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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 # Create submission | 611 # Create submission |
| 612 # https://msdn.microsoft.com/en-us/windows/uwp/monetize/create-an-app-su
bmission | 612 # https://msdn.microsoft.com/en-us/windows/uwp/monetize/create-an-app-su
bmission |
| 613 request = urllib2.Request(submissions_path, '', headers) | 613 request = urllib2.Request(submissions_path, '', headers) |
| 614 request.get_method = lambda: 'POST' | 614 request.get_method = lambda: 'POST' |
| 615 with contextlib.closing(opener.open(request)) as response: | 615 with contextlib.closing(opener.open(request)) as response: |
| 616 submission = json.load(response) | 616 submission = json.load(response) |
| 617 | 617 |
| 618 submission_id = submission['id'] | 618 submission_id = submission['id'] |
| 619 file_upload_url = submission['fileUploadUrl'] | 619 file_upload_url = submission['fileUploadUrl'] |
| 620 | 620 |
| 621 # Update submission |
| 622 submission['applicationPackages'][0]['fileStatus'] = 'PendingDelete' |
| 623 submission['applicationPackages'].append({ |
| 624 'fileStatus': 'PendingUpload', |
| 625 'fileName': os.path.basename(self.path), |
| 626 }) |
| 627 |
| 621 new_submission_path = '{}/{}'.format(submissions_path, | 628 new_submission_path = '{}/{}'.format(submissions_path, |
| 622 submission_id) | 629 submission_id) |
| 630 new_submission = json.dumps(submission) |
| 623 | 631 |
| 624 request = urllib2.Request(new_submission_path, None, headers) | 632 request = urllib2.Request(new_submission_path, new_submission, headers) |
| 633 request.get_method = lambda: 'PUT' |
| 625 opener.open(request).close() | 634 opener.open(request).close() |
| 626 | 635 |
| 627 self.upload_appx_file_to_windows_store(file_upload_url) | 636 self.upload_appx_file_to_windows_store(file_upload_url) |
| 628 | 637 |
| 629 # Commit submission | 638 # Commit submission |
| 630 # https://msdn.microsoft.com/en-us/windows/uwp/monetize/commit-an-app-su
bmission | 639 # https://msdn.microsoft.com/en-us/windows/uwp/monetize/commit-an-app-su
bmission |
| 631 commit_path = '{}/commit'.format(new_submission_path) | 640 commit_path = '{}/commit'.format(new_submission_path) |
| 632 request = urllib2.Request(commit_path, '', headers) | 641 request = urllib2.Request(commit_path, '', headers) |
| 633 request.get_method = lambda: 'POST' | 642 request.get_method = lambda: 'POST' |
| 634 with contextlib.closing(opener.open(request)) as response: | 643 with contextlib.closing(opener.open(request)) as response: |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 except Exception as ex: | 733 except Exception as ex: |
| 725 logging.error('The build for %s failed:', repo) | 734 logging.error('The build for %s failed:', repo) |
| 726 logging.exception(ex) | 735 logging.exception(ex) |
| 727 | 736 |
| 728 file = open(nightlyConfigFile, 'wb') | 737 file = open(nightlyConfigFile, 'wb') |
| 729 nightlyConfig.write(file) | 738 nightlyConfig.write(file) |
| 730 | 739 |
| 731 | 740 |
| 732 if __name__ == '__main__': | 741 if __name__ == '__main__': |
| 733 main() | 742 main() |
| OLD | NEW |