Open facundobatista opened 4 years ago
It looks its only purpose is to provide a "holder" to move some data around, so you can do...
'imagePath': image_meta.image_path,
...instead of...
'imagePath': image_meta['registrypath'],
As it doesn't have other functionality, you could just use a namedtuple:
>>> from collections import namedtuple >>> ImageMeta = namedtuple('ImageMeta', 'image_path repo_username repo_password') >>> rd = dict(registrypath='foo', username='bar', password='baz') >>> im = ImageMeta(image_path=rd['registrypath'], repo_username=rd['username'], repo_password=rd['password']) >>> im.image_path 'foo'
It looks its only purpose is to provide a "holder" to move some data around, so you can do...
...instead of...
As it doesn't have other functionality, you could just use a namedtuple: