in src/kibble-scanner.py [0:0]
def run(self):
global BIG_LOCK, PENDING_OBJECTS
time.sleep(0.5) # Primarily to align printouts.
# While there are objects to snag
a = 0
while PENDING_OBJECTS:
BIG_LOCK.acquire(blocking = True)
try:
# Try grabbing an object (might not be any left!)
obj = PENDING_OBJECTS.pop(0)
except:
pass
BIG_LOCK.release()
if obj:
# If load balancing jobs, make sure this one is ours
if isMine(obj['sourceID'], self.broker.config):
# Run through list of scanners in order, apply when useful
for sid, scanner in plugins.scanners.enumerate():
if scanner.accepts(obj):
self.bit.pluginname = "plugins/scanners/" + sid
# Excluded scanner type?
if self.exclude and sid in self.exclude:
continue
# Specific scanner type or no types mentioned?
if not self.stype or self.stype == sid:
scanner.scan(self.bit, obj)
else:
break
self.bit.pluginname = "core"
self.bit.pprint("No more objects, exiting!")