mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
184: Renamed public.mthd class to Method
This commit is contained in:
@@ -37,19 +37,19 @@ api.register(discover)
|
|||||||
|
|
||||||
|
|
||||||
# Register some methods for the 'user' object:
|
# Register some methods for the 'user' object:
|
||||||
class user_add(public.mthd):
|
class user_add(public.Method):
|
||||||
'Add new user'
|
'Add new user'
|
||||||
api.register(user_add)
|
api.register(user_add)
|
||||||
|
|
||||||
class user_del(public.mthd):
|
class user_del(public.Method):
|
||||||
'Delete existing user'
|
'Delete existing user'
|
||||||
api.register(user_del)
|
api.register(user_del)
|
||||||
|
|
||||||
class user_mod(public.mthd):
|
class user_mod(public.Method):
|
||||||
'Edit existing user'
|
'Edit existing user'
|
||||||
api.register(user_mod)
|
api.register(user_mod)
|
||||||
|
|
||||||
class user_find(public.mthd):
|
class user_find(public.Method):
|
||||||
'Search for users'
|
'Search for users'
|
||||||
api.register(user_find)
|
api.register(user_find)
|
||||||
|
|
||||||
@@ -89,37 +89,37 @@ api.register(user_initials)
|
|||||||
|
|
||||||
|
|
||||||
# Register some methods for the 'group' object:
|
# Register some methods for the 'group' object:
|
||||||
class group_add(public.mthd):
|
class group_add(public.Method):
|
||||||
'Add new group'
|
'Add new group'
|
||||||
api.register(group_add)
|
api.register(group_add)
|
||||||
|
|
||||||
class group_del(public.mthd):
|
class group_del(public.Method):
|
||||||
'Delete existing group'
|
'Delete existing group'
|
||||||
api.register(group_del)
|
api.register(group_del)
|
||||||
|
|
||||||
class group_mod(public.mthd):
|
class group_mod(public.Method):
|
||||||
'Edit existing group'
|
'Edit existing group'
|
||||||
api.register(group_mod)
|
api.register(group_mod)
|
||||||
|
|
||||||
class group_find(public.mthd):
|
class group_find(public.Method):
|
||||||
'Search for groups'
|
'Search for groups'
|
||||||
api.register(group_find)
|
api.register(group_find)
|
||||||
|
|
||||||
|
|
||||||
# Register some methods for the 'service' object
|
# Register some methods for the 'service' object
|
||||||
class service_add(public.mthd):
|
class service_add(public.Method):
|
||||||
'Add new service'
|
'Add new service'
|
||||||
api.register(service_add)
|
api.register(service_add)
|
||||||
|
|
||||||
class service_del(public.mthd):
|
class service_del(public.Method):
|
||||||
'Delete existing service'
|
'Delete existing service'
|
||||||
api.register(service_del)
|
api.register(service_del)
|
||||||
|
|
||||||
class service_mod(public.mthd):
|
class service_mod(public.Method):
|
||||||
'Edit existing service'
|
'Edit existing service'
|
||||||
api.register(service_mod)
|
api.register(service_mod)
|
||||||
|
|
||||||
class service_find(public.mthd):
|
class service_find(public.Method):
|
||||||
'Search for services'
|
'Search for services'
|
||||||
api.register(service_find)
|
api.register(service_find)
|
||||||
|
|
||||||
|
|||||||
@@ -251,15 +251,15 @@ class Command(plugable.Plugin):
|
|||||||
|
|
||||||
class obj(plugable.Plugin):
|
class obj(plugable.Plugin):
|
||||||
__public__ = frozenset((
|
__public__ = frozenset((
|
||||||
'mthd',
|
'Method',
|
||||||
'prop',
|
'prop',
|
||||||
))
|
))
|
||||||
__mthd = None
|
__Method = None
|
||||||
__prop = None
|
__prop = None
|
||||||
|
|
||||||
def __get_mthd(self):
|
def __get_Method(self):
|
||||||
return self.__mthd
|
return self.__Method
|
||||||
mthd = property(__get_mthd)
|
Method = property(__get_Method)
|
||||||
|
|
||||||
def __get_prop(self):
|
def __get_prop(self):
|
||||||
return self.__prop
|
return self.__prop
|
||||||
@@ -267,7 +267,7 @@ class obj(plugable.Plugin):
|
|||||||
|
|
||||||
def finalize(self, api):
|
def finalize(self, api):
|
||||||
super(obj, self).finalize(api)
|
super(obj, self).finalize(api)
|
||||||
self.__mthd = self.__create_ns('mthd')
|
self.__Method = self.__create_ns('Method')
|
||||||
self.__prop = self.__create_ns('prop')
|
self.__prop = self.__create_ns('prop')
|
||||||
|
|
||||||
def __create_ns(self, name):
|
def __create_ns(self, name):
|
||||||
@@ -315,7 +315,7 @@ class attr(plugable.Plugin):
|
|||||||
self.__obj = api.obj[self.obj_name]
|
self.__obj = api.obj[self.obj_name]
|
||||||
|
|
||||||
|
|
||||||
class mthd(attr, Command):
|
class Method(attr, Command):
|
||||||
__public__ = attr.__public__.union(Command.__public__)
|
__public__ = attr.__public__.union(Command.__public__)
|
||||||
|
|
||||||
def get_options(self):
|
def get_options(self):
|
||||||
@@ -335,4 +335,4 @@ class prop(attr, option):
|
|||||||
|
|
||||||
class PublicAPI(plugable.API):
|
class PublicAPI(plugable.API):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(PublicAPI, self).__init__(Command, obj, mthd, prop)
|
super(PublicAPI, self).__init__(Command, obj, Method, prop)
|
||||||
|
|||||||
@@ -350,11 +350,11 @@ def test_attr():
|
|||||||
o = example_prop0()
|
o = example_prop0()
|
||||||
|
|
||||||
|
|
||||||
class test_mthd(ClassChecker):
|
class test_Method(ClassChecker):
|
||||||
"""
|
"""
|
||||||
Tests the `public.mthd` class.
|
Tests the `public.Method` class.
|
||||||
"""
|
"""
|
||||||
_cls = public.mthd
|
_cls = public.Method
|
||||||
|
|
||||||
def test_class(self):
|
def test_class(self):
|
||||||
assert self.cls.__bases__ == (public.attr, public.Command)
|
assert self.cls.__bases__ == (public.attr, public.Command)
|
||||||
@@ -390,7 +390,7 @@ class test_mthd(ClassChecker):
|
|||||||
|
|
||||||
def test_get_options(self):
|
def test_get_options(self):
|
||||||
"""
|
"""
|
||||||
Tests the `public.mthd.get_options` method.
|
Tests the `public.Method.get_options` method.
|
||||||
"""
|
"""
|
||||||
sub = self.subcls()
|
sub = self.subcls()
|
||||||
names = ('option0', 'option1', 'prop0', 'prop1')
|
names = ('option0', 'option1', 'prop0', 'prop1')
|
||||||
|
|||||||
Reference in New Issue
Block a user