~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Jonathan Riddell
  • Date: 2011-09-16 10:41:45 UTC
  • mto: This revision was merged to the branch mainline in revision 6144.
  • Revision ID: jriddell@canonical.com-20110916104145-eu7v8gkip5hi0ur1
more error gettext()ing

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
    trace,
48
48
    win32utils,
49
49
    )
 
50
from bzrlib.i18n import gettext
50
51
""")
51
52
 
52
53
from bzrlib.symbol_versioning import (
89
90
        user_encoding = get_user_encoding()
90
91
        return [a.decode(user_encoding) for a in sys.argv[1:]]
91
92
    except UnicodeDecodeError:
92
 
        raise errors.BzrError("Parameter %r encoding is unsupported by %s "
93
 
            "application locale." % (a, user_encoding))
 
93
        raise errors.BzrError(gettext("Parameter {0!r} encoding is unsupported by {1} "
 
94
            "application locale.").format(a, user_encoding))
94
95
 
95
96
 
96
97
def make_readonly(filename):
190
191
            if e.errno == errno.ENOENT:
191
192
                return False;
192
193
            else:
193
 
                raise errors.BzrError("lstat/stat of (%r): %r" % (f, e))
 
194
                raise errors.BzrError(gettext("lstat/stat of ({0!r}): {1!r}").format(f, e))
194
195
 
195
196
 
196
197
def fancy_rename(old, new, rename_func, unlink_func):
925
926
    rps = []
926
927
    for f in ps:
927
928
        if f == '..':
928
 
            raise errors.BzrError("sorry, %r not allowed in path" % f)
 
929
            raise errors.BzrError(gettext("sorry, %r not allowed in path") % f)
929
930
        elif (f == '.') or (f == ''):
930
931
            pass
931
932
        else:
936
937
def joinpath(p):
937
938
    for f in p:
938
939
        if (f == '..') or (f is None) or (f == ''):
939
 
            raise errors.BzrError("sorry, %r not allowed in path" % f)
 
940
            raise errors.BzrError(gettext("sorry, %r not allowed in path") % f)
940
941
    return pathjoin(*p)
941
942
 
942
943
 
1154
1155
 
1155
1156
    if len(base) < MIN_ABS_PATHLENGTH:
1156
1157
        # must have space for e.g. a drive letter
1157
 
        raise ValueError('%r is too short to calculate a relative path'
 
1158
        raise ValueError(gettext('%r is too short to calculate a relative path')
1158
1159
            % (base,))
1159
1160
 
1160
1161
    rp = abspath(path)