From 100f8ad6e866983b6fe1846382ed4ee4d090bae9 Mon Sep 17 00:00:00 2001 From: Andreas Demmelbauer Date: Fri, 24 Sep 2021 10:56:00 +0200 Subject: [PATCH] remove return --- demotape.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/demotape.py b/demotape.py index 65b88cc..8241961 100644 --- a/demotape.py +++ b/demotape.py @@ -126,7 +126,7 @@ def download_stream(channel, dest_path): def process_channel(channel): - #logging.info('entered function process_channel with ' + channel['name']) + logging.info('entered function process_channel with ' + channel['name']) while True: logging.info(timestamp() + ' checking ' + channel['name']) @@ -159,17 +159,18 @@ def upload_video(videofile_path): # Upload to cloud using webdav result = os.system('curl -L -u %s -T "%s" "%s"' % (credentials, videofile_path, webdav_url)) if result == 0: # exit code + logging.info('Uploaded sucessfully %s to %s' % (filename, webdav_url)) delete_video(videofile_path) - return True except: - logging.info('Error while uploading %s to %s' % (file, webdav_url)) + logging.info('Error while uploading %s to %s' % (filename, webdav_url)) def delete_video(file): try: logging.info('Deleting Video %s' % (file)) - os.system('rm -rf "%s"' % (file)) - return True + result = os.system('rm -rf "%s"' % (file)) + if result == 0: # exit code + logging.info('Deleted sucessfully {}'.format(file)) except: logging.info('Error while deleting %s' % (file))