mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
358: Cleaned up private methods in Object
This commit is contained in:
parent
e84dd7a69d
commit
4267422793
@ -522,23 +522,24 @@ class Object(plugable.Plugin):
|
|||||||
|
|
||||||
def set_api(self, api):
|
def set_api(self, api):
|
||||||
super(Object, self).set_api(api)
|
super(Object, self).set_api(api)
|
||||||
self.methods = self.__create_namespace('Method')
|
self.methods = plugable.NameSpace(
|
||||||
self.properties = self.__create_namespace('Property')
|
self.__get_attrs('Method'), sort=False
|
||||||
|
)
|
||||||
|
self.properties = plugable.NameSpace(
|
||||||
|
self.__get_attrs('Property'), sort=False
|
||||||
|
)
|
||||||
self.params = plugable.NameSpace(
|
self.params = plugable.NameSpace(
|
||||||
self.__create_params(), sort=False
|
self.__get_params(), sort=False
|
||||||
)
|
)
|
||||||
|
|
||||||
def __create_namespace(self, name):
|
def __get_attrs(self, name):
|
||||||
return plugable.NameSpace(self.__filter_members(name))
|
|
||||||
|
|
||||||
def __filter_members(self, name):
|
|
||||||
namespace = getattr(self.api, name)
|
namespace = getattr(self.api, name)
|
||||||
assert type(namespace) is plugable.NameSpace
|
assert type(namespace) is plugable.NameSpace
|
||||||
for proxy in namespace(): # Equivalent to dict.itervalues()
|
for proxy in namespace(): # Equivalent to dict.itervalues()
|
||||||
if proxy.obj_name == self.name:
|
if proxy.obj_name == self.name:
|
||||||
yield proxy.__clone__('attr_name')
|
yield proxy.__clone__('attr_name')
|
||||||
|
|
||||||
def __create_params(self):
|
def __get_params(self):
|
||||||
props = self.properties.__todict__()
|
props = self.properties.__todict__()
|
||||||
for spec in self.takes_params:
|
for spec in self.takes_params:
|
||||||
if type(spec) is str:
|
if type(spec) is str:
|
||||||
|
Loading…
Reference in New Issue
Block a user