/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/chk_serializer.py

  • Committer: Breezy landing bot
  • Author(s): Martin
  • Date: 2017-06-05 21:50:19 UTC
  • mfrom: (6656.1.3 dict_viewing)
  • Revision ID: breezy.the.bot@gmail.com-20170605215019-uw7s07tx11p194kh
Apply 2to3 dict fixer and clean up with sixish view methods

Merged from https://code.launchpad.net/~gz/brz/dict_viewing/+merge/325108

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
def _validate_properties(props, _decode=cache_utf8._utf8_decode):
42
42
    # TODO: we really want an 'isascii' check for key
43
43
    # Cast the utf8 properties into Unicode 'in place'
44
 
    for key, value in props.iteritems():
 
44
    for key, value in props.items():
45
45
        props[key] = _decode(value)[0]
46
46
    return props
47
47
 
90
90
        # For bzr revisions, the most common property is just 'branch-nick'
91
91
        # which changes infrequently.
92
92
        revprops = {}
93
 
        for key, value in rev.properties.iteritems():
 
93
        for key, value in rev.properties.items():
94
94
            revprops[key] = encode_utf8(value)[0]
95
95
        ret.append(('properties', revprops))
96
96
        ret.extend([
131
131
                value = validator(value)
132
132
            bits[var_name] = value
133
133
        if len(bits) != len(schema):
134
 
            missing = [key for key, (var_name, _, _) in schema.iteritems()
 
134
            missing = [key for key, (var_name, _, _) in schema.items()
135
135
                       if var_name not in bits]
136
136
            raise ValueError('Revision text was missing expected keys %s.'
137
137
                             ' text %r' % (missing, text))