def list_tab(user):
 data = raw_cron(user)
 ret = {'pre': [], 'crons': [], 'special': [], 'env': []}
 flag = False
 comment = None
 identifier = None
 for line in data.splitlines():
  if (line == '# Lines below here are managed by Salt, do not edit'):
   flag = True
   continue
  if flag:
   commented_cron_job = False
   if line.startswith('#DISABLED#'):
    line = line[10:]
    commented_cron_job = True
   if line.startswith('@'):
    dat = {}
    comps = line.split()
    if (len(comps) < 2):
     continue
    dat['spec'] = comps[0]
    dat['cmd'] = ' '.join(comps[1:])
    ret['special'].append(dat)
   elif line.startswith('#'):
    comment_line = line.lstrip('# ')
    if (SALT_CRON_IDENTIFIER in comment_line):
     parts = comment_line.split(SALT_CRON_IDENTIFIER)
     comment_line = parts[0].rstrip()
     if (len(parts[1]) > 1):
      identifier = parts[1][1:]
    if (comment is None):
     comment = comment_line
    else:
     comment += ('\n' + comment_line)
   elif ((line.find('=') > 0) and ((' ' not in line) or (line.index('=') < line.index(' ')))):
    comps = line.split('=', 1)
    dat = {}
    dat['name'] = comps[0]
    dat['value'] = comps[1]
    ret['env'].append(dat)
   elif (len(line.split(' ')) > 5):
    comps = line.split(' ')
    dat = {'minute': comps[0], 'hour': comps[1], 'daymonth': comps[2], 'month': comps[3], 'dayweek': comps[4], 'identifier': identifier, 'cmd': ' '.join(comps[5:]), 'comment': comment, 'commented': False}
    if commented_cron_job:
     dat['commented'] = True
    ret['crons'].append(dat)
    identifier = None
    comment = None
    commented_cron_job = False
  else:
   ret['pre'].append(line)
 return ret

def list_tab ( user ) : data = raw_cron ( user ) ret = { 'pre' : [ ] , 'crons' : [ ] , 'special' : [ ] , 'env' : [ ] } flag = False comment = None identifier = None for line in data . splitlines ( ) : if ( line == '# Lines below here are managed by Salt, do not edit' ) : flag = True continue if flag : commented_cron_job = False if line . startswith ( '#DISABLED#' ) : line = line [ 10 : ] commented_cron_job = True if line . startswith ( '@' ) : dat = { } comps = line . split ( ) if ( len ( comps ) < 2 ) : continue dat [ 'spec' ] = comps [ 0 ] dat [ 'cmd' ] = ' ' . join ( comps [ 1 : ] ) ret [ 'special' ] . append ( dat ) elif line . startswith ( '#' ) : comment_line = line . lstrip ( '# ' ) if ( SALT_CRON_IDENTIFIER in comment_line ) : parts = comment_line . split ( SALT_CRON_IDENTIFIER ) comment_line = parts [ 0 ] . rstrip ( ) if ( len ( parts [ 1 ] ) > 1 ) : identifier = parts [ 1 ] [ 1 : ] if ( comment is None ) : comment = comment_line else : comment += ( '\n' + comment_line ) elif ( ( line . find ( '=' ) > 0 ) and ( ( ' ' not in line ) or ( line . index ( '=' ) < line . index ( ' ' ) ) ) ) : comps = line . split ( '=' , 1 ) dat = { } dat [ 'name' ] = comps [ 0 ] dat [ 'value' ] = comps [ 1 ] ret [ 'env' ] . append ( dat ) elif ( len ( line . split ( ' ' ) ) > 5 ) : comps = line . split ( ' ' ) dat = { 'minute' : comps [ 0 ] , 'hour' : comps [ 1 ] , 'daymonth' : comps [ 2 ] , 'month' : comps [ 3 ] , 'dayweek' : comps [ 4 ] , 'identifier' : identifier , 'cmd' : ' ' . join ( comps [ 5 : ] ) , 'comment' : comment , 'commented' : False } if commented_cron_job : dat [ 'commented' ] = True ret [ 'crons' ] . append ( dat ) identifier = None comment = None commented_cron_job = False else : ret [ 'pre' ] . append ( line ) return ret
return the contents of the specified users incrontab cli example: .