def del_hist_job(job, del_files):
 if job:
  path = PostProcessor.do.get_path(job)
  if path:
   PostProcessor.do.delete(job, del_files=del_files)
  else:
   history_db = sabnzbd.connect_db()
   path = history_db.get_path(job)
   history_db.remove_history(job)
  if (path and del_files and clip_path(path).lower().startswith(cfg.download_dir.get_path().lower())):
   remove_all(path, recursive=True)
 return True

def del_hist_job ( job , del_files ) : if job : path = PostProcessor . do . get_path ( job ) if path : PostProcessor . do . delete ( job , del_files = del_files ) else : history_db = sabnzbd . connect_db ( ) path = history_db . get_path ( job ) history_db . remove_history ( job ) if ( path and del_files and clip_path ( path ) . lower ( ) . startswith ( cfg . download_dir . get_path ( ) . lower ( ) ) ) : remove_all ( path , recursive = True ) return True
remove history element .