def __init__(self, pkg_instance, initial_settings=None, disabled_settings=None, unchangable_settings=None): """ :type pkg_instance: :obj:`pkgcore.package.metadata.package` :param pkg_instance: instance to wrap. :type initial_settings: sequence :param initial_settings: initial configuration of the configurable_attribute :type unchangable_settings: sequence :param unchangable_settings: settings that configurable_attribute cannot be set to """ if initial_settings is None: initial_settings = [] if disabled_settings is None: disabled_settings = [] if unchangable_settings is None: unchangable_settings = [] sf = object.__setattr__ sf(self, '_unchangable', unchangable_settings) sf(self, '_configurable', LimitedChangeSet(initial_settings, unchangable_settings)) sf(self, '_disabled', disabled_settings) sf(self, '_reuse_pt', 0) sf(self, '_cached_wrapped', {}) wrapper.__init__(self, pkg_instance)
def __init__(self, pkg, overrides): """ :param pkg: :obj:`pkgcore.package.metadata.package` to wrap :param overrides: is an attr -> instance mapping to substitute when the attr is requested """ wrapper.__init__(self, pkg) object.__setattr__(self, "_overrides", overrides)