fixed tar archive handling

This commit is contained in:
kageru 2018-01-31 20:04:08 +01:00
parent c8ced9eca4
commit 6b00517c84
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2

View File

@ -67,9 +67,9 @@ def ftp_upload(sourcefile, *, mode=None, ext=None) -> tuple:
'screenshot': 'png',
'text': 'txt',
}
if re.search('\.tar\.\w{1,4}]', sourcefile):
if re.search('\.tar\.\w{1,4}', sourcefile):
# properly handle .tar.something files
ext = sourcefile.split('.')[-2:]
ext = '.'.join(sourcefile.split('.')[-2:])
else:
ext = exts.get(mode, mode not in exts and sourcefile.split('.')[-1]) # Only do the split if necessary