| OLD | NEW |
| (Empty) |
| 1 #!/usr/bin/env python | |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """Creates a dartx archive. | |
| 7 """ | |
| 8 | |
| 9 import argparse | |
| 10 import os | |
| 11 import sys | |
| 12 import zipfile | |
| 13 | |
| 14 def main(): | |
| 15 parser = argparse.ArgumentParser(description='dartx packager.') | |
| 16 parser.add_argument('--snapshot', | |
| 17 help='Snapshot file.', | |
| 18 type=str) | |
| 19 parser.add_argument('--output', | |
| 20 help='Path to output archive.', | |
| 21 type=str) | |
| 22 arguments = parser.parse_args() | |
| 23 | |
| 24 snapshot = arguments.snapshot | |
| 25 output = arguments.output | |
| 26 | |
| 27 with zipfile.ZipFile(output, 'w', zipfile.ZIP_DEFLATED) as outfile: | |
| 28 outfile.write(snapshot, 'snapshot_blob.bin') | |
| 29 | |
| 30 return 0 | |
| 31 | |
| 32 if __name__ == '__main__': | |
| 33 sys.exit(main()) | |
| OLD | NEW |