~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockdir.py

  • Committer: Patch Queue Manager
  • Date: 2011-09-20 14:38:17 UTC
  • mfrom: (6150.3.12 i18n-more-gettext)
  • Revision ID: pqm@pqm.ubuntu.com-20110920143817-505fvpundix8tqv8
(jr) adding gettext() to more strings
 (Jonathan Riddell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
        )
138
138
from bzrlib.trace import mutter, note
139
139
from bzrlib.osutils import format_delta, rand_chars, get_host_name
 
140
from bzrlib.i18n import gettext
140
141
 
141
142
from bzrlib.lazy_import import lazy_import
142
143
lazy_import(globals(), """
316
317
            self.transport.delete(tmpname + self.__INFO_NAME)
317
318
            self.transport.rmdir(tmpname)
318
319
        except PathError, e:
319
 
            note("error removing pending lock: %s", e)
 
320
            note(gettext("error removing pending lock: %s"), e)
320
321
 
321
322
    def _create_pending_dir(self):
322
323
        tmpname = '%s/%s.tmp' % (self.path, rand_chars(10))
611
612
            new_info = self.peek()
612
613
            if new_info is not None and new_info != last_info:
613
614
                if last_info is None:
614
 
                    start = 'Unable to obtain'
 
615
                    start = gettext('Unable to obtain')
615
616
                else:
616
 
                    start = 'Lock owner changed for'
 
617
                    start = gettext('Lock owner changed for')
617
618
                last_info = new_info
618
 
                msg = u'%s lock %s %s.' % (start, lock_url, new_info)
 
619
                msg = gettext('{0} lock {1} {2}.').format(start, lock_url,
 
620
                                                                    new_info)
619
621
                if deadline_str is None:
620
622
                    deadline_str = time.strftime('%H:%M:%S',
621
623
                                                    time.localtime(deadline))
622
624
                if timeout > 0:
623
 
                    msg += ('\nWill continue to try until %s, unless '
624
 
                        'you press Ctrl-C.'
625
 
                        % deadline_str)
626
 
                msg += '\nSee "bzr help break-lock" for more.'
 
625
                    msg += '\n' + gettext(
 
626
                             'Will continue to try until %s, unless '
 
627
                             'you press Ctrl-C.') % deadline_str
 
628
                msg += '\n' + gettext('See "bzr help break-lock" for more.')
627
629
                self._report_function(msg)
628
630
            if (max_attempts is not None) and (attempt_count >= max_attempts):
629
631
                self._trace("exceeded %d attempts")
732
734
    def __unicode__(self):
733
735
        """Return a user-oriented description of this object."""
734
736
        d = self.to_readable_dict()
735
 
        return (
 
737
        return ( gettext(
736
738
            u'held by %(user)s on %(hostname)s (process #%(pid)s), '
737
 
            u'acquired %(time_ago)s' % d)
 
739
            u'acquired %(time_ago)s') % d)
738
740
 
739
741
    def to_readable_dict(self):
740
742
        """Turn the holder info into a dict of human-readable attributes.