Remove __cache__, __pcache__ and related code.

This commit is contained in:
Odd Stråbø 2019-07-14 19:33:27 +02:00
parent c574d7ceb3
commit 6bac723da3
8 changed files with 7 additions and 76 deletions

View file

@ -277,13 +277,12 @@ def write_xml(content, file):
content = content.replace('?>', ' standalone="yes" ?>', 1)
infile.write(content)
def delete_folder(path=None):
def delete_folder(path):
''' Delete objects from kodi cache
'''
LOG.debug("--[ delete folder ]")
delete_path = path is not None
path = path or xbmc.translatePath('special://temp/jellyfin').decode('utf-8')
dirs, files = xbmcvfs.listdir(path)
delete_recursive(path, dirs)
@ -291,11 +290,11 @@ def delete_folder(path=None):
for file in files:
xbmcvfs.delete(os.path.join(path, file.decode('utf-8')))
if delete_path:
xbmcvfs.delete(path)
xbmcvfs.delete(path)
LOG.info("DELETE %s", path)
def delete_recursive(path, dirs):
''' Delete files and dirs recursively.
@ -309,6 +308,7 @@ def delete_recursive(path, dirs):
delete_recursive(os.path.join(path, directory.decode('utf-8')), dirs2)
xbmcvfs.rmdir(os.path.join(path, directory.decode('utf-8')))
def unzip(path, dest, folder=None):
''' Unzip file. zipfile module seems to fail on android with badziperror.