瀏覽代碼

remove return

master
Andreas Demmelbauer 3 年之前
父節點
當前提交
100f8ad6e8
共有 1 個檔案被更改,包括 6 行新增5 行删除
  1. +6
    -5
      demotape.py

+ 6
- 5
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))



Loading…
取消
儲存