OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Archives a set of files to a server.""" | 6 """Archives a set of files to a server.""" |
7 | 7 |
8 __version__ = '0.2' | 8 __version__ = '0.2' |
9 | 9 |
10 import functools | 10 import functools |
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1645 if not options.isolate_server: | 1645 if not options.isolate_server: |
1646 self.error('--isolate-server is required.') | 1646 self.error('--isolate-server is required.') |
1647 return options, args | 1647 return options, args |
1648 | 1648 |
1649 | 1649 |
1650 def main(args): | 1650 def main(args): |
1651 dispatcher = subcommand.CommandDispatcher(__name__) | 1651 dispatcher = subcommand.CommandDispatcher(__name__) |
1652 try: | 1652 try: |
1653 return dispatcher.execute( | 1653 return dispatcher.execute( |
1654 OptionParserIsolateServer(version=__version__), args) | 1654 OptionParserIsolateServer(version=__version__), args) |
1655 except (ConfigError, MappingError) as e: | 1655 except Exception as e: |
1656 sys.stderr.write('\nError: ') | 1656 tools.report_error(e) |
1657 sys.stderr.write(str(e)) | |
1658 sys.stderr.write('\n') | |
1659 return 1 | 1657 return 1 |
1660 | 1658 |
1661 | 1659 |
1662 if __name__ == '__main__': | 1660 if __name__ == '__main__': |
1663 fix_encoding.fix_encoding() | 1661 fix_encoding.fix_encoding() |
1664 tools.disable_buffering() | 1662 tools.disable_buffering() |
1665 colorama.init() | 1663 colorama.init() |
1666 sys.exit(main(sys.argv[1:])) | 1664 sys.exit(main(sys.argv[1:])) |
OLD | NEW |