# commands.append([str(match)for match in matches])
#logger.debug("found cron command " + str(commands))
logger.info("Found " + str(num) + " cron jobs")
- subtitle = str(num) + " cron jobs run"
- section.add_data(Data(subtitle))
+ jobs_data = Data(str(num) + " cron jobs run")
+ section.append_data(jobs_data)
+
if (len(matches) > 0):
- commands = ("`{0}`".format(x) for x in commands)
- commands = orderbyfreq(list(commands))
- commands = truncl(commands, config.prefs['maxcmd'])
- section.add_data(Data("top cron commands", commands))
+ logger.debug("Analysing cron commands")
+ cmd_data = Data("Top cron commands")
+ cmd_data.items = ("`{0}`".format(x) for x in commands)
+ cmd_data.orderbyfreq()
+ cmd_data.truncl(config.prefs['maxcmd'])
+ section.append_data(cmd_data)
+
logger.info("Finished cron section")
return section