Browse Source

remove return

master
Andreas Demmelbauer 2 years ago
parent
commit
100f8ad6e8
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      demotape.py

+ 6
- 5
demotape.py View File

@@ -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))



Loading…
Cancel
Save