From 9138cdbb67af76a2c17288266d43c3a2202a5a38 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Thu, 11 May 2017 19:44:08 +0200 Subject: [PATCH] Repace Kodi mkdirs with os.makedirs - Partially fixes #296 --- resources/lib/PlexAPI.py | 5 +++-- resources/lib/entrypoint.py | 5 ++--- resources/lib/utils.py | 6 +++--- resources/lib/videonodes.py | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index 07572f40..fbd28e7c 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -40,10 +40,11 @@ from re import compile as re_compile, sub from json import dumps from urllib import urlencode, quote_plus, unquote from os.path import basename, join +from os import makedirs import xbmcgui from xbmc import sleep, executebuiltin -from xbmcvfs import mkdirs, exists +from xbmcvfs import exists import clientinfo as client from downloadutils import DownloadUtils @@ -2344,7 +2345,7 @@ class API(): Returns the path to the downloaded subtitle or None """ if not exists_dir(v.EXTERNAL_SUBTITLE_TEMP_PATH): - mkdirs(v.EXTERNAL_SUBTITLE_TEMP_PATH) + makedirs(v.EXTERNAL_SUBTITLE_TEMP_PATH) path = join(v.EXTERNAL_SUBTITLE_TEMP_PATH, filename) r = DownloadUtils().downloadUrl(url, return_response=True) try: diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index a7f14d23..8ab911cd 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -2,7 +2,7 @@ ############################################################################### import logging from shutil import copyfile -from os import walk +from os import walk, makedirs from os.path import basename, join from sys import argv from urllib import urlencode @@ -10,7 +10,6 @@ from urllib import urlencode import xbmcplugin from xbmc import sleep, executebuiltin, translatePath from xbmcgui import ListItem -from xbmcvfs import mkdirs from utils import window, settings, language as lang, dialog, tryEncode, \ CatchExceptions, JSONRPC, exists_dir @@ -540,7 +539,7 @@ def getExtraFanArt(plexid, plexPath): fanartDir = translatePath("special://thumbnails/plex/%s/" % plexid) if not exists_dir(fanartDir): # Download the images to the cache directory - mkdirs(fanartDir) + makedirs(fanartDir) xml = GetPlexMetadata(plexid) if xml is None: log.error('Could not download metadata for %s' % plexid) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 7d17bd0c..e94f7555 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -14,14 +14,14 @@ import xml.etree.ElementTree as etree from functools import wraps from calendar import timegm from os.path import join -from os import remove, walk +from os import remove, walk, makedirs from shutil import rmtree from urllib import quote_plus import xbmc import xbmcaddon import xbmcgui -from xbmcvfs import exists, mkdirs, delete +from xbmcvfs import exists, delete from variables import DB_VIDEO_PATH, DB_MUSIC_PATH, DB_TEXTURE_PATH, \ DB_PLEX_PATH, KODI_PROFILE, KODIVERSION @@ -809,7 +809,7 @@ def playlistXSP(mediatype, tagname, viewid, viewtype="", delete=False): # Create the playlist directory if not exists(path): log.info("Creating directory: %s" % path) - mkdirs(path) + makedirs(path) # Only add the playlist if it doesn't already exists if exists(xsppath): diff --git a/resources/lib/videonodes.py b/resources/lib/videonodes.py index 94fa9701..f6561ad8 100644 --- a/resources/lib/videonodes.py +++ b/resources/lib/videonodes.py @@ -3,11 +3,11 @@ import logging from shutil import copytree import xml.etree.ElementTree as etree -from os import remove, listdir +from os import remove, listdir, makedirs from os.path import isfile, join import xbmc -from xbmcvfs import mkdirs, exists +from xbmcvfs import exists from utils import window, settings, language as lang, tryEncode, indent, \ normalize_nodes, exists_dir @@ -85,7 +85,7 @@ class VideoNodes(object): if not exists_dir(nodepath): # folder does not exist yet log.debug('Creating folder %s' % nodepath) - mkdirs(nodepath) + makedirs(nodepath) # Create index entry nodeXML = "%sindex.xml" % nodepath