why do you wipe the crontab if the check_output fails for some reason?
this occurs several times
+ try:
+ subprocess.check_output(['crontab', '-l'])
+ except subprocess.CalledProcessError:
+ newcron = subprocess.Popen(['crontab', '-'], stdin = subprocess.PIPE)
+ newcron.communicate("")
I'm guessing this is a typo and it should be -l in the second call too.
I don't really see why you use the try, except at all
just stick with the second version or copy paste the check_output code into your program if you want python 2.6 compatibility
why do you wipe the crontab if the check_output fails for some reason? check_output( ['crontab' , '-l']) CalledProcessEr ror: Popen([ 'crontab' , '-'], stdin = subprocess.PIPE) communicate( "")
this occurs several times
+ try:
+ subprocess.
+ except subprocess.
+ newcron = subprocess.
+ newcron.
I'm guessing this is a typo and it should be -l in the second call too.
I don't really see why you use the try, except at all
just stick with the second version or copy paste the check_output code into your program if you want python 2.6 compatibility