<s> """<STR_LIT>""" <EOL> import crontab <EOL> from grr . lib import parsers <EOL> from grr . lib import utils <EOL> from grr . lib . rdfvalues import cronjobs as rdf_cronjobs <EOL> class CronTabParser ( parsers . FileParser ) : <EOL> """<STR_LIT>""" <EOL> output_types = [ "<STR_LIT>" ] <EOL> supported_artifacts = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> def Parse ( self , stat , file_object , knowledge_base ) : <EOL> """<STR_LIT>""" <EOL> _ = knowledge_base <EOL> entries = [ ] <EOL> crondata = file_object . read ( <NUM_LIT> ) <EOL> jobs = crontab . CronTab ( tab = crondata ) <EOL> for job in jobs : <EOL> entries . append ( <EOL> rdf_cronjobs . CronTabEntry ( minute = utils . SmartStr ( job . minute ) , <EOL> hour = utils . SmartStr ( job . hour ) , <EOL> dayofmonth = utils . SmartStr ( job . dom ) , <EOL> month = utils . SmartStr ( job . month ) , <EOL> dayofweek = utils . SmartStr ( job . dow ) , <EOL> command = utils . SmartStr ( job . command ) , <EOL> comment = utils . SmartStr ( job . comment ) ) ) <EOL> yield rdf_cronjobs . CronTabFile ( aff4path = stat . aff4path , jobs = entries ) </s>
