mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-11-15 04:45:49 +01:00
fixes for unicode strs
This commit is contained in:
parent
a1c0c0bbfe
commit
495ecb1048
@ -1,3 +1,4 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
from kodi_six import xbmc, xbmcgui, xbmcvfs
|
from kodi_six import xbmc, xbmcgui, xbmcvfs
|
||||||
@ -87,7 +88,7 @@ class XbmcBackup:
|
|||||||
|
|
||||||
for aFile in files:
|
for aFile in files:
|
||||||
file_ext = aFile.split('.')[-1]
|
file_ext = aFile.split('.')[-1]
|
||||||
folderName = utils.encode(aFile.split('.')[0])
|
folderName = aFile.split('.')[0]
|
||||||
|
|
||||||
if(file_ext == 'zip' and len(folderName) == 12 and str.isdigit(folderName)):
|
if(file_ext == 'zip' and len(folderName) == 12 and str.isdigit(folderName)):
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
import zipfile
|
import zipfile
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
@ -92,7 +93,7 @@ class ZipFileSystem(Vfs):
|
|||||||
|
|
||||||
aFile = xbmcvfs.File(xbmc.translatePath(source),'r')
|
aFile = xbmcvfs.File(xbmc.translatePath(source),'r')
|
||||||
|
|
||||||
self.zip.writestr(utils.encode(dest),aFile.read())
|
self.zip.writestr(dest,aFile.readBytes())
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -140,9 +141,9 @@ class DropboxFileSystem(Vfs):
|
|||||||
|
|
||||||
for aFile in metadata.entries:
|
for aFile in metadata.entries:
|
||||||
if(isinstance(aFile,dropbox.files.FolderMetadata)):
|
if(isinstance(aFile,dropbox.files.FolderMetadata)):
|
||||||
dirs.append(utils.encode(aFile.name))
|
dirs.append(aFile.name)
|
||||||
else:
|
else:
|
||||||
files.append(utils.encode(aFile.name))
|
files.append(aFile.name)
|
||||||
|
|
||||||
return [dirs,files]
|
return [dirs,files]
|
||||||
else:
|
else:
|
||||||
@ -304,9 +305,9 @@ class GoogleDriveFilesystem(Vfs):
|
|||||||
|
|
||||||
for aFile in fileList:
|
for aFile in fileList:
|
||||||
if(aFile['mimeType'] == self.FOLDER_TYPE):
|
if(aFile['mimeType'] == self.FOLDER_TYPE):
|
||||||
dirs.append(utils.encode(aFile['title']))
|
dirs.append(aFile['title'])
|
||||||
else:
|
else:
|
||||||
files.append(utils.encode(aFile['title']))
|
files.append(aFile['title'])
|
||||||
|
|
||||||
|
|
||||||
return [dirs,files]
|
return [dirs,files]
|
||||||
|
Loading…
Reference in New Issue
Block a user