CO - Bug found with folder initialization

community
Gogs 7 years ago
parent e8dce098ec
commit ce08f55f81

@ -270,8 +270,10 @@ def InitCollector():
lagents.append(agent)
if id in a :
#-- This variable should not be confused with defined namespace
_actor = eval(a[id]+"()")
print _actor.getName()
_actor.init(args)
lactors.append(_actor)
config = dict(CONFIG)

@ -183,11 +183,9 @@ class Folders(Actor):
"""
def init(self,args):
Actor.init(self,args)
#self.lfolders = args['folders'] #config['folders']
#self.action = args['action'] #{clear,archive} config['actions']['folders']
self.threshold = self.get_size( args['threshold']) #self.config['threshold'])
self.item = args['folders']
def archive(self,item):
"""
@ -238,8 +236,6 @@ class Folders(Actor):
p : folder exists
q : has_reached threashold
"""
p = os.path.exists(item['label']) and item['label'] in self.lfolders
q = self.get_size(item['size']) >= self.threshold
return p and q

@ -146,7 +146,8 @@ class Manager() :
def apply_setup(self,name,args) :
for actor in self.actors :
if args is not None and actor.getName() == name and len(args.keys()) > 0:
actor.init(args)
pass
#actor.init(args)
def __setup(self,meta):
@ -234,7 +235,7 @@ class Manager() :
#
index = self.agents.index(agent)
if len(self.actors) > index and self.actors[index].getIdentifier() == agent.getName() :
if len(self.actors) > index and self.actors[index].getName() == agent.getName() :
actor = self.actors[index]
print actor.analyze(row)

Loading…
Cancel
Save