OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright 2008 Google Inc. All Rights Reserved. | 3 # Copyright 2008 Google Inc. All Rights Reserved. |
4 # | 4 # |
5 # Licensed under the Apache License, Version 2.0 (the "License"); | 5 # Licensed under the Apache License, Version 2.0 (the "License"); |
6 # you may not use this file except in compliance with the License. | 6 # you may not use this file except in compliance with the License. |
7 # You may obtain a copy of the License at | 7 # You may obtain a copy of the License at |
8 # | 8 # |
9 # http://www.apache.org/licenses/LICENSE-2.0 | 9 # http://www.apache.org/licenses/LICENSE-2.0 |
10 # | 10 # |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 hooks = [ | 62 hooks = [ |
63 { "pattern": "\\.(gif|jpe?g|pr0n|png)$", | 63 { "pattern": "\\.(gif|jpe?g|pr0n|png)$", |
64 "action": ["python", "image_indexer.py", "--all"]}, | 64 "action": ["python", "image_indexer.py", "--all"]}, |
65 ] | 65 ] |
66 """ | 66 """ |
67 | 67 |
68 __author__ = "darinf@gmail.com (Darin Fisher)" | 68 __author__ = "darinf@gmail.com (Darin Fisher)" |
69 __version__ = "0.3.3" | 69 __version__ = "0.3.3" |
70 | 70 |
71 import errno | 71 import errno |
| 72 import logging |
72 import optparse | 73 import optparse |
73 import os | 74 import os |
74 import re | 75 import re |
75 import stat | 76 import stat |
76 import sys | 77 import sys |
77 import urlparse | 78 import urlparse |
78 import urllib | 79 import urllib |
79 | 80 |
80 import gclient_scm | 81 import gclient_scm |
81 import gclient_utils | 82 import gclient_utils |
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 if argv[1] == '--help': | 1162 if argv[1] == '--help': |
1162 argv[1] = 'help' | 1163 argv[1] = 'help' |
1163 | 1164 |
1164 command = argv[1] | 1165 command = argv[1] |
1165 options, args = option_parser.parse_args(argv[2:]) | 1166 options, args = option_parser.parse_args(argv[2:]) |
1166 | 1167 |
1167 if len(argv) < 3 and command == "help": | 1168 if len(argv) < 3 and command == "help": |
1168 option_parser.print_help() | 1169 option_parser.print_help() |
1169 return 0 | 1170 return 0 |
1170 | 1171 |
| 1172 if options.verbose: |
| 1173 logging.basicConfig(level=logging.DEBUG) |
| 1174 |
1171 # Files used for configuration and state saving. | 1175 # Files used for configuration and state saving. |
1172 options.config_filename = os.environ.get("GCLIENT_FILE", ".gclient") | 1176 options.config_filename = os.environ.get("GCLIENT_FILE", ".gclient") |
1173 options.entries_filename = ".gclient_entries" | 1177 options.entries_filename = ".gclient_entries" |
1174 options.deps_file = "DEPS" | 1178 options.deps_file = "DEPS" |
1175 | 1179 |
1176 options.platform = sys.platform | 1180 options.platform = sys.platform |
1177 return DispatchCommand(command, options, args) | 1181 return DispatchCommand(command, options, args) |
1178 | 1182 |
1179 | 1183 |
1180 if "__main__" == __name__: | 1184 if "__main__" == __name__: |
1181 try: | 1185 try: |
1182 result = Main(sys.argv) | 1186 result = Main(sys.argv) |
1183 except Error, e: | 1187 except Error, e: |
1184 print >> sys.stderr, "Error: %s" % str(e) | 1188 print >> sys.stderr, "Error: %s" % str(e) |
1185 result = 1 | 1189 result = 1 |
1186 sys.exit(result) | 1190 sys.exit(result) |
1187 | 1191 |
1188 # vim: ts=2:sw=2:tw=80:et: | 1192 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |