Repace Kodi mkdirs with os.makedirs

- Partially fixes #296
This commit is contained in:
tomkat83 2017-05-11 19:44:08 +02:00
parent 03a1893bdb
commit 9138cdbb67
4 changed files with 11 additions and 11 deletions

View file

@ -40,10 +40,11 @@ from re import compile as re_compile, sub
from json import dumps from json import dumps
from urllib import urlencode, quote_plus, unquote from urllib import urlencode, quote_plus, unquote
from os.path import basename, join from os.path import basename, join
from os import makedirs
import xbmcgui import xbmcgui
from xbmc import sleep, executebuiltin from xbmc import sleep, executebuiltin
from xbmcvfs import mkdirs, exists from xbmcvfs import exists
import clientinfo as client import clientinfo as client
from downloadutils import DownloadUtils from downloadutils import DownloadUtils
@ -2344,7 +2345,7 @@ class API():
Returns the path to the downloaded subtitle or None Returns the path to the downloaded subtitle or None
""" """
if not exists_dir(v.EXTERNAL_SUBTITLE_TEMP_PATH): 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) path = join(v.EXTERNAL_SUBTITLE_TEMP_PATH, filename)
r = DownloadUtils().downloadUrl(url, return_response=True) r = DownloadUtils().downloadUrl(url, return_response=True)
try: try:

View file

@ -2,7 +2,7 @@
############################################################################### ###############################################################################
import logging import logging
from shutil import copyfile from shutil import copyfile
from os import walk from os import walk, makedirs
from os.path import basename, join from os.path import basename, join
from sys import argv from sys import argv
from urllib import urlencode from urllib import urlencode
@ -10,7 +10,6 @@ from urllib import urlencode
import xbmcplugin import xbmcplugin
from xbmc import sleep, executebuiltin, translatePath from xbmc import sleep, executebuiltin, translatePath
from xbmcgui import ListItem from xbmcgui import ListItem
from xbmcvfs import mkdirs
from utils import window, settings, language as lang, dialog, tryEncode, \ from utils import window, settings, language as lang, dialog, tryEncode, \
CatchExceptions, JSONRPC, exists_dir CatchExceptions, JSONRPC, exists_dir
@ -540,7 +539,7 @@ def getExtraFanArt(plexid, plexPath):
fanartDir = translatePath("special://thumbnails/plex/%s/" % plexid) fanartDir = translatePath("special://thumbnails/plex/%s/" % plexid)
if not exists_dir(fanartDir): if not exists_dir(fanartDir):
# Download the images to the cache directory # Download the images to the cache directory
mkdirs(fanartDir) makedirs(fanartDir)
xml = GetPlexMetadata(plexid) xml = GetPlexMetadata(plexid)
if xml is None: if xml is None:
log.error('Could not download metadata for %s' % plexid) log.error('Could not download metadata for %s' % plexid)

View file

@ -14,14 +14,14 @@ import xml.etree.ElementTree as etree
from functools import wraps from functools import wraps
from calendar import timegm from calendar import timegm
from os.path import join from os.path import join
from os import remove, walk from os import remove, walk, makedirs
from shutil import rmtree from shutil import rmtree
from urllib import quote_plus from urllib import quote_plus
import xbmc import xbmc
import xbmcaddon import xbmcaddon
import xbmcgui 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, \ from variables import DB_VIDEO_PATH, DB_MUSIC_PATH, DB_TEXTURE_PATH, \
DB_PLEX_PATH, KODI_PROFILE, KODIVERSION DB_PLEX_PATH, KODI_PROFILE, KODIVERSION
@ -809,7 +809,7 @@ def playlistXSP(mediatype, tagname, viewid, viewtype="", delete=False):
# Create the playlist directory # Create the playlist directory
if not exists(path): if not exists(path):
log.info("Creating directory: %s" % path) log.info("Creating directory: %s" % path)
mkdirs(path) makedirs(path)
# Only add the playlist if it doesn't already exists # Only add the playlist if it doesn't already exists
if exists(xsppath): if exists(xsppath):

View file

@ -3,11 +3,11 @@
import logging import logging
from shutil import copytree from shutil import copytree
import xml.etree.ElementTree as etree import xml.etree.ElementTree as etree
from os import remove, listdir from os import remove, listdir, makedirs
from os.path import isfile, join from os.path import isfile, join
import xbmc import xbmc
from xbmcvfs import mkdirs, exists from xbmcvfs import exists
from utils import window, settings, language as lang, tryEncode, indent, \ from utils import window, settings, language as lang, tryEncode, indent, \
normalize_nodes, exists_dir normalize_nodes, exists_dir
@ -85,7 +85,7 @@ class VideoNodes(object):
if not exists_dir(nodepath): if not exists_dir(nodepath):
# folder does not exist yet # folder does not exist yet
log.debug('Creating folder %s' % nodepath) log.debug('Creating folder %s' % nodepath)
mkdirs(nodepath) makedirs(nodepath)
# Create index entry # Create index entry
nodeXML = "%sindex.xml" % nodepath nodeXML = "%sindex.xml" % nodepath