| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2010 Google Inc. All Rights Reserved. | 2 # Copyright 2010 Google Inc. All Rights Reserved. |
| 3 # | 3 # |
| 4 # Licensed under the Apache License, Version 2.0 (the "License"); | 4 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 # you may not use this file except in compliance with the License. | 5 # you may not use this file except in compliance with the License. |
| 6 # You may obtain a copy of the License at | 6 # You may obtain a copy of the License at |
| 7 # | 7 # |
| 8 # http://www.apache.org/licenses/LICENSE-2.0 | 8 # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 # | 9 # |
| 10 # Unless required by applicable law or agreed to in writing, software | 10 # Unless required by applicable law or agreed to in writing, software |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 # and removed by set_data(). | 730 # and removed by set_data(). |
| 731 CHUNK_EDIT_SEPARATOR = '[WEB_PAGE_REPLAY_CHUNK_BOUNDARY]' | 731 CHUNK_EDIT_SEPARATOR = '[WEB_PAGE_REPLAY_CHUNK_BOUNDARY]' |
| 732 | 732 |
| 733 # DELAY_EDIT_SEPARATOR is used to edit and view server delays. | 733 # DELAY_EDIT_SEPARATOR is used to edit and view server delays. |
| 734 DELAY_EDIT_SEPARATOR = ('\n[WEB_PAGE_REPLAY_EDIT_ARCHIVE --- ' | 734 DELAY_EDIT_SEPARATOR = ('\n[WEB_PAGE_REPLAY_EDIT_ARCHIVE --- ' |
| 735 'Delays are above. Response content is below.]\n') | 735 'Delays are above. Response content is below.]\n') |
| 736 | 736 |
| 737 # This date was used in deterministic.js prior to switching to recorded | 737 # This date was used in deterministic.js prior to switching to recorded |
| 738 # request time. See https://github.com/chromium/web-page-replay/issues/71 | 738 # request time. See https://github.com/chromium/web-page-replay/issues/71 |
| 739 # for details. | 739 # for details. |
| 740 DEFAULT_REQUEST_TIME = datetime.datetime(2008, 2, 29) | 740 DEFAULT_REQUEST_TIME = datetime.datetime(2008, 2, 29, 2, 26, 8, 254000) |
| 741 | 741 |
| 742 def __init__(self, version, status, reason, headers, response_data, | 742 def __init__(self, version, status, reason, headers, response_data, |
| 743 delays=None, request_time=None): | 743 delays=None, request_time=None): |
| 744 """Initialize an ArchivedHttpResponse. | 744 """Initialize an ArchivedHttpResponse. |
| 745 | 745 |
| 746 Args: | 746 Args: |
| 747 version: HTTP protocol version used by server. | 747 version: HTTP protocol version used by server. |
| 748 10 for HTTP/1.0, 11 for HTTP/1.1 (same as httplib). | 748 10 for HTTP/1.0, 11 for HTTP/1.1 (same as httplib). |
| 749 status: Status code returned by server (e.g. 200). | 749 status: Status code returned by server (e.g. 200). |
| 750 reason: Reason phrase returned by server (e.g. "OK"). | 750 reason: Reason phrase returned by server (e.g. "OK"). |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 elif command == 'edit': | 1072 elif command == 'edit': |
| 1073 http_archive.edit(options.command, options.host, options.full_path) | 1073 http_archive.edit(options.command, options.host, options.full_path) |
| 1074 http_archive.Persist(replay_file) | 1074 http_archive.Persist(replay_file) |
| 1075 else: | 1075 else: |
| 1076 option_parser.error('Unknown command "%s"' % command) | 1076 option_parser.error('Unknown command "%s"' % command) |
| 1077 return 0 | 1077 return 0 |
| 1078 | 1078 |
| 1079 | 1079 |
| 1080 if __name__ == '__main__': | 1080 if __name__ == '__main__': |
| 1081 sys.exit(main()) | 1081 sys.exit(main()) |
| OLD | NEW |