revert signature of Accessibles.copy() method
no more kwds arguments, method 'merge' should be used Change-Id: I7028d9df8b69c018dcdc0c55d3ae0f71e24ee15b
This commit is contained in:
@@ -60,11 +60,8 @@ class Accessible(HasProperties):
|
||||
"""override with a bare value"""
|
||||
raise NotImplementedError
|
||||
|
||||
def copy(self, **kwds):
|
||||
"""return a (deep) copy of ourselfs
|
||||
|
||||
:param kwds: override given properties
|
||||
"""
|
||||
def copy(self):
|
||||
"""return a (deep) copy of ourselfs"""
|
||||
raise NotImplementedError
|
||||
|
||||
def updateProperties(self, merged_properties):
|
||||
@@ -223,15 +220,11 @@ class Parameter(Accessible):
|
||||
else:
|
||||
raise ProgrammingError('can not use %r as name of a Parameter' % self.name)
|
||||
|
||||
def copy(self, **kwds):
|
||||
"""return a (deep) copy of ourselfs
|
||||
|
||||
:param kwds: override given properties
|
||||
"""
|
||||
def copy(self):
|
||||
"""return a (deep) copy of ourselfs"""
|
||||
res = type(self)()
|
||||
res.name = self.name
|
||||
res.init(self.propertyValues)
|
||||
res.init(kwds)
|
||||
if 'datatype' in self.propertyValues:
|
||||
res.datatype = res.datatype.copy()
|
||||
return res
|
||||
@@ -407,16 +400,12 @@ class Command(Accessible):
|
||||
self.func = func
|
||||
return self
|
||||
|
||||
def copy(self, **kwds):
|
||||
"""return a (deep) copy of ourselfs
|
||||
|
||||
:param kwds: override given properties
|
||||
"""
|
||||
def copy(self):
|
||||
"""return a (deep) copy of ourselfs"""
|
||||
res = type(self)()
|
||||
res.name = self.name
|
||||
res.func = self.func
|
||||
res.init(self.propertyValues)
|
||||
res.init(kwds)
|
||||
if res.argument:
|
||||
res.argument = res.argument.copy()
|
||||
if res.result:
|
||||
@@ -435,6 +424,8 @@ class Command(Accessible):
|
||||
if not callable(value):
|
||||
raise ProgrammingError('%s = %r is overriding a Command' % (self.name, value))
|
||||
self.func = value
|
||||
if value.__doc__:
|
||||
self.description = inspect.cleandoc(value.__doc__)
|
||||
|
||||
def merge(self, merged_properties):
|
||||
"""merge with inherited properties
|
||||
|
||||
Reference in New Issue
Block a user