

def get_context(self, *args, **kwargs):
    context = super(JSONFormat, self).get_context(*args, **kwargs)
    frames = OrderedDict([[i['filename'], {
        'filename': i['filename'],
        'frame': {
            'x': i['x'],
            'y': i['y'],
            'w': i['width'],
            'h': i['height'],
        },
        'rotated': False,
        'trimmed': False,
        'spriteSourceSize': {
            'x': i['x'],
            'y': i['y'],
            'w': i['width'],
            'h': i['height'],
        },
        'sourceSize': {
            'w': i['original_width'],
            'h': i['original_height'],
        },
    }] for i in context['images']])
    data = OrderedDict(frames=None, meta={
        'version': context['version'],
        'hash': context['hash'],
        'name': context['name'],
        'sprite_path': context['sprite_path'],
        'sprite_filename': context['sprite_filename'],
        'width': context['width'],
        'height': context['height'],
    })
    if (self.sprite.config['json_format'] == 'array'):
        data['frames'] = frames.values()
    else:
        data['frames'] = frames
    return data

dataset/ETHPy150Open jorgebastida/glue/glue/formats/jsonformat.py JSONFormat.get_context/original