Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ``python-apt`` functionality #341

merged 8 commits into from Aug 13, 2019

Use AttributeDict trick for ``_container`` class

  • Loading branch information...
fnordahl committed Aug 13, 2019
commit 5a95dc63c4a1cb950562e129290b0860b1eaf907
@@ -40,17 +40,10 @@
import subprocess

class _container(object):
class _container(dict):
"""Simple container for attributes."""
def __init__(self, attr_map):
"""Initialize package attribute container.
:param attr_map: Dictionary key value pairs to transform into
attributes with a value on instance of the class.
:type attr_map: Dict[str, str]
for k, v in attr_map.items():
setattr(self, k, v)
__getattr__ = dict.__getitem__
__setattr__ = dict.__setitem__

class Package(_container):
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.