mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-20 16:43:43 +00:00
Merge branch 'hotfix/0.12.24'
This commit is contained in:
commit
8bb5d054d2
3 changed files with 15 additions and 3 deletions
|
@ -1,4 +1,9 @@
|
|||
### 0.12.23 (2017-07-18 16:55:00 UTC)
|
||||
### 0.12.24 (2017-07-31 20:42:00 UTC)
|
||||
|
||||
* Fix copy post process method on posix
|
||||
|
||||
|
||||
### 0.12.23 (2017-07-18 16:55:00 UTC)
|
||||
|
||||
* Remove obsolete tvrage_api lib
|
||||
|
||||
|
|
|
@ -59,11 +59,18 @@ def callPeopleStupid(x):
|
|||
return x.encode(sickbeard.SYS_ENCODING, 'ignore')
|
||||
|
||||
|
||||
def fixParaLists(x):
|
||||
if type(x) == list:
|
||||
return [callPeopleStupid(a) if type(a) in (str, unicode) else a for a in x]
|
||||
else:
|
||||
return x
|
||||
|
||||
|
||||
def ek(func, *args, **kwargs):
|
||||
if os.name == 'nt':
|
||||
result = func(*args, **kwargs)
|
||||
else:
|
||||
result = func(*[callPeopleStupid(x) if type(x) in (str, unicode) else x for x in args], **kwargs)
|
||||
result = func(*[callPeopleStupid(x) if type(x) in (str, unicode) else fixParaLists(x) for x in args], **kwargs)
|
||||
|
||||
if type(result) in (list, tuple):
|
||||
return fixListEncodings(result)
|
||||
|
|
|
@ -299,7 +299,7 @@ def listMediaFiles(path):
|
|||
|
||||
def copyFile(srcFile, destFile):
|
||||
if os.name.startswith('posix'):
|
||||
subprocess.call(['cp', srcFile, destFile])
|
||||
ek.ek(subprocess.call, ['cp', srcFile, destFile])
|
||||
else:
|
||||
ek.ek(shutil.copyfile, srcFile, destFile)
|
||||
|
||||
|
|
Loading…
Reference in a new issue