def rm_job(user, path, mask, cmd):
 mask = str(mask).upper()
 for item in mask.split(','):
  if (item not in _MASK_TYPES):
   return 'Invalid mask type: {0}'.format(item)
 lst = list_tab(user)
 ret = 'absent'
 rm_ = None
 for ind in range(len(lst['crons'])):
  if (rm_ is not None):
   break
  if (path == lst['crons'][ind]['path']):
   if (cmd == lst['crons'][ind]['cmd']):
    if (mask == lst['crons'][ind]['mask']):
     rm_ = ind
 if (rm_ is not None):
  lst['crons'].pop(rm_)
  ret = 'removed'
 comdat = _write_incron_lines(user, _render_tab(lst))
 if comdat['retcode']:
  return comdat['stderr']
 return ret

def rm_job ( user , path , mask , cmd ) : mask = str ( mask ) . upper ( ) for item in mask . split ( ',' ) : if ( item not in _MASK_TYPES ) : return 'Invalid mask type: {0}' . format ( item ) lst = list_tab ( user ) ret = 'absent' rm_ = None for ind in range ( len ( lst [ 'crons' ] ) ) : if ( rm_ is not None ) : break if ( path == lst [ 'crons' ] [ ind ] [ 'path' ] ) : if ( cmd == lst [ 'crons' ] [ ind ] [ 'cmd' ] ) : if ( mask == lst [ 'crons' ] [ ind ] [ 'mask' ] ) : rm_ = ind if ( rm_ is not None ) : lst [ 'crons' ] . pop ( rm_ ) ret = 'removed' comdat = _write_incron_lines ( user , _render_tab ( lst ) ) if comdat [ 'retcode' ] : return comdat [ 'stderr' ] return ret
remove a incron job for a specified user .