ziptools atv fix
This commit is contained in:
@@ -23,7 +23,7 @@ class ziptools(object):
|
||||
if not dir.endswith(':') and not filetools.exists(dir):
|
||||
filetools.mkdir(dir)
|
||||
|
||||
zf = zipfile.ZipFile(file)
|
||||
zf = zipfile.ZipFile(filetools.file_open(file, vfs=False))
|
||||
if not folder_to_extract:
|
||||
self._createstructure(file, dir)
|
||||
num_files = len(zf.namelist())
|
||||
@@ -93,7 +93,7 @@ class ziptools(object):
|
||||
filetools.mkdir(curdir)
|
||||
|
||||
def _listdirs(self, file):
|
||||
zf = zipfile.ZipFile(file)
|
||||
zf = zipfile.ZipFile(filetools.file_open(file, vfs=False))
|
||||
dirs = []
|
||||
for name in zf.namelist():
|
||||
if name.endswith('/'):
|
||||
@@ -104,7 +104,7 @@ class ziptools(object):
|
||||
|
||||
def zip(self, dir, file):
|
||||
import os
|
||||
zf = zipfile.ZipFile(file, "w", zipfile.ZIP_DEFLATED)
|
||||
zf = zipfile.ZipFile(filetools.file_open(file, "w", vfs=False), "w", zipfile.ZIP_DEFLATED)
|
||||
abs_src = os.path.abspath(dir)
|
||||
for dirname, subdirs, files in os.walk(dir):
|
||||
for filename in files:
|
||||
|
||||
@@ -109,9 +109,9 @@ def dialog_textviewer(heading, text): # available from kodi 16
|
||||
return xbmcgui.Dialog().textviewer(heading, text)
|
||||
|
||||
|
||||
def dialog_browse(_type, heading, default=""):
|
||||
def dialog_browse(_type, heading, shares="files", mask="", useThumbs=False, treatAsFolder=False, defaultt="", enableMultiple=False):
|
||||
dialog = xbmcgui.Dialog()
|
||||
d = dialog.browse(_type, heading, 'files')
|
||||
d = dialog.browse(_type, heading, shares, mask, useThumbs, treatAsFolder, defaultt, enableMultiple)
|
||||
return d
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ def export_videolibrary(item):
|
||||
def import_videolibrary(item):
|
||||
logger.info()
|
||||
|
||||
zip_file = u'' + platformtools.dialog_browse(1, config.get_localized_string(80005))
|
||||
zip_file = u'' + platformtools.dialog_browse(1, config.get_localized_string(80005), mask=".zip")
|
||||
if zip_file == "":
|
||||
return
|
||||
if not platformtools.dialog_yesno(config.get_localized_string(20000), config.get_localized_string(80006)):
|
||||
|
||||
Reference in New Issue
Block a user