/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/cmdline.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
configuring_bazaar.txt.
21
21
"""
22
22
 
 
23
from __future__ import absolute_import
 
24
 
23
25
import re
24
26
 
25
27
 
26
 
_whitespace_match = re.compile(u'\\s', re.UNICODE).match
 
28
_whitespace_match = re.compile(u'\s', re.UNICODE).match
27
29
 
28
30
 
29
31
class _PushbackSequence(object):
31
33
        self._iter = iter(orig)
32
34
        self._pushback_buffer = []
33
35
 
34
 
    def __next__(self):
 
36
    def next(self):
35
37
        if len(self._pushback_buffer) > 0:
36
38
            return self._pushback_buffer.pop()
37
39
        else:
38
 
            return next(self._iter)
39
 
 
40
 
    next = __next__
 
40
            return self._iter.next()
41
41
 
42
42
    def pushback(self, char):
43
43
        self._pushback_buffer.append(char)
91
91
            return self
92
92
        elif next_char in context.allowed_quote_chars:
93
93
            # 2N backslashes followed by a quote are N backslashes
94
 
            context.token.append(u'\\' * (self.count // 2))
 
94
            context.token.append(u'\\' * (self.count/2))
95
95
            # 2N+1 backslashes follwed by a quote are N backslashes followed by
96
96
            # the quote which should not be processed as the start or end of
97
97
            # the quoted arg
140
140
    def __iter__(self):
141
141
        return self
142
142
 
143
 
    def __next__(self):
 
143
    def next(self):
144
144
        quoted, token = self._get_token()
145
145
        if token is None:
146
146
            raise StopIteration
147
147
        return quoted, token
148
148
 
149
 
    next = __next__
150
 
 
151
149
    def _get_token(self):
152
150
        self.quoted = False
153
151
        self.token = []
156
154
            state = state.process(next_char, self)
157
155
            if state is None:
158
156
                break
159
 
        if state is not None and not getattr(state, 'finish', None) is None:
 
157
        if not state is None and not getattr(state, 'finish', None) is None:
160
158
            state.finish(self)
161
159
        result = u''.join(self.token)
162
160
        if not self.quoted and result == '':