comments on the code

This commit is contained in:
gwen 2012-12-05 11:12:04 +01:00
parent 7574ac43aa
commit 69d747baec
1 changed files with 7 additions and 1 deletions

View File

@ -51,7 +51,10 @@ class Multi(list):
self.config = config
self.opt = opt
if self.opt.is_master(config):
# we pass the list at the list type's init
# because a normal init cannot return anything
super(Multi, self).__init__(lst)
# we add the slaves without modifying the master
for l in lst:
try:
self.append(l, add_master=False)
@ -66,7 +69,10 @@ class Multi(list):
def append(self, value, add_master=True):
"""the list value can be updated (appened)
only if the option is a master"""
only if the option is a master
:param add_master: adds slaves without modifiying the master option
if True, adds slaves **and** the master option
"""
try:
master = self.config._cfgimpl_descr.get_master_name()
if master != self.opt._name: