/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 breezy/cmdline.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-08 00:00:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6672.
  • Revision ID: jelmer@jelmer.uk-20170608000028-e3ggtt4wjbcjh91j
Drop pycurl support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2010 Canonical Ltd
 
1
# Copyright (C) 2010-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Unicode-compatible command-line splitter for all platforms."""
 
17
"""Unicode-compatible command-line splitter for all platforms.
 
18
 
 
19
The user-visible behaviour of this module is described in
 
20
configuring_bazaar.txt.
 
21
"""
 
22
 
 
23
from __future__ import absolute_import
18
24
 
19
25
import re
20
26
 
27
33
        self._iter = iter(orig)
28
34
        self._pushback_buffer = []
29
35
 
30
 
    def next(self):
 
36
    def __next__(self):
31
37
        if len(self._pushback_buffer) > 0:
32
38
            return self._pushback_buffer.pop()
33
39
        else:
34
 
            return self._iter.next()
 
40
            return next(self._iter)
 
41
 
 
42
    next = __next__
35
43
 
36
44
    def pushback(self, char):
37
45
        self._pushback_buffer.append(char)
66
74
        if next_char == u'\\':
67
75
            return _Backslash(self)
68
76
        elif next_char == self.quote_char:
 
77
            context.token.append(u'')
69
78
            return self.exit_state
70
79
        else:
71
80
            context.token.append(next_char)
133
142
    def __iter__(self):
134
143
        return self
135
144
 
136
 
    def next(self):
 
145
    def __next__(self):
137
146
        quoted, token = self._get_token()
138
147
        if token is None:
139
148
            raise StopIteration
140
149
        return quoted, token
141
150
 
 
151
    next = __next__
 
152
 
142
153
    def _get_token(self):
143
154
        self.quoted = False
144
155
        self.token = []