reformat code according to pep8

This commit is contained in:
VirtuBox
2019-04-29 02:06:32 +02:00
parent 0508592d2a
commit 9de9ba8637
6 changed files with 57 additions and 51 deletions

View File

@@ -7,8 +7,10 @@ Set CRON on LINUX system.
class WOCron():
def setcron_weekly(self, cmd, comment='Cron set by WordOps', user='root', min=0, hour=12):
if not WOShellExec.cmd_exec(self, "crontab -l | grep -q \'{0}\'".format(cmd)):
def setcron_weekly(self, cmd, comment='Cron set by WordOps', user='root',
min=0, hour=12):
if not WOShellExec.cmd_exec(self, "crontab -l "
"| grep -q \'{0}\'".format(cmd)):
WOShellExec.cmd_exec(self, "/bin/bash -c \"crontab -l "
"2> /dev/null | {{ cat; echo -e"
@@ -20,7 +22,8 @@ class WOCron():
Log.debug(self, "Cron set")
def remove_cron(self, cmd):
if WOShellExec.cmd_exec(self, "crontab -l | grep -q \'{0}\'".format(cmd)):
if WOShellExec.cmd_exec(self, "crontab -l "
"| grep -q \'{0}\'".format(cmd)):
if not WOShellExec.cmd_exec(self, "/bin/bash -c "
"\"crontab "
"-l | sed '/{0}/d'"