diff options
author | Shawn O. Pearce <sop@google.com> | 2009-04-16 08:25:57 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2009-04-16 08:25:57 -0700 |
commit | 48244781c2cad1565b4b32b4524ff9931a39f848 (patch) | |
tree | d408008547b22af4141ba4593064bda618e04ab7 /project.py | |
parent | 19a83d80854d88f079f8d6530812b50948f0e28c (diff) | |
download | git-repo-48244781c2cad1565b4b32b4524ff9931a39f848.tar.gz |
Refactor error message display in project.py
Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -34,6 +34,10 @@ R_TAGS = 'refs/tags/' | |||
34 | R_PUB = 'refs/published/' | 34 | R_PUB = 'refs/published/' |
35 | R_M = 'refs/remotes/m/' | 35 | R_M = 'refs/remotes/m/' |
36 | 36 | ||
37 | def _error(fmt, *args): | ||
38 | msg = fmt % args | ||
39 | print >>sys.stderr, 'error: %s' % msg | ||
40 | |||
37 | def _warn(fmt, *args): | 41 | def _warn(fmt, *args): |
38 | msg = fmt % args | 42 | msg = fmt % args |
39 | print >>sys.stderr, 'warn: %s' % msg | 43 | print >>sys.stderr, 'warn: %s' % msg |
@@ -199,9 +203,7 @@ class _CopyFile: | |||
199 | mode = mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH) | 203 | mode = mode & ~(stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH) |
200 | os.chmod(dest, mode) | 204 | os.chmod(dest, mode) |
201 | except IOError: | 205 | except IOError: |
202 | print >>sys.stderr, \ | 206 | _error('Cannot copy file %s to %s', src, dest) |
203 | 'error: Cannot copy file %s to %s' \ | ||
204 | % (src, dest) | ||
205 | 207 | ||
206 | 208 | ||
207 | class Project(object): | 209 | class Project(object): |