~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/util/bencode.py

  • Committer: Sidnei da Silva
  • Date: 2009-05-29 14:19:29 UTC
  • mto: (4531.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4532.
  • Revision ID: sidnei.da.silva@canonical.com-20090529141929-3heywbvj36po72a5
- Add initial config

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
        return (r, f + 1)
87
87
 
88
88
    def bdecode(self, x):
89
 
        if type(x) != str:
90
 
            raise TypeError
91
89
        try:
92
90
            r, l = self.decode_func[x[0]](x, 0)
93
91
        except (IndexError, KeyError):
154
152
        encode_int(int(x), r)
155
153
    encode_func[BooleanType] = encode_bool
156
154
 
157
 
from bzrlib._static_tuple_py import StaticTuple
158
 
encode_func[StaticTuple] = encode_list
159
 
try:
160
 
    from bzrlib._static_tuple_c import StaticTuple
161
 
except ImportError:
162
 
    pass
163
 
else:
164
 
    encode_func[StaticTuple] = encode_list
165
 
 
166
155
 
167
156
def bencode(x):
168
157
    r = []