Skip to content

Commit 9e8520c

Browse files
authored
Merge pull request #15 from heitbaum/master
[python] update xbmc.translatePath() to xbmcvfs
2 parents 7d22378 + 47b893c commit 9e8520c

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

resources/lib/addon.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ def __init__(self, params, ltype, rule, attrib, pathrule, orderby):
4444
self.PATHRULE = pathrule
4545
self.ORDERBY = orderby
4646
# If there are no custom library nodes in the profile directory, copy them from the Kodi install
47-
targetDir = os.path.join( xbmc.translatePath( "special://profile" ), "library", ltype )
47+
targetDir = os.path.join( xbmcvfs.translatePath( "special://profile" ), "library", ltype )
4848
if True:
4949
if not os.path.exists( targetDir ):
5050
xbmcvfs.mkdirs( targetDir )
51-
originDir = os.path.join( xbmc.translatePath( "special://xbmc" ), "system", "library", ltype )
51+
originDir = os.path.join( xbmcvfs.translatePath( "special://xbmc" ), "system", "library", ltype )
5252
dirs, files = xbmcvfs.listdir( originDir )
5353
self.copyNode( dirs, files, targetDir, originDir )
5454
else:
@@ -189,7 +189,7 @@ def __init__(self, params, ltype, rule, attrib, pathrule, orderby):
189189
if selected != -1 and selected != 0:
190190
try:
191191
# Copy those defaults across
192-
originDir = os.path.join( xbmc.translatePath( "special://xbmc" ), "system", "library", self.ltype, defaultValues[ selected ] )
192+
originDir = os.path.join( xbmcvfs.translatePath( "special://xbmc" ), "system", "library", self.ltype, defaultValues[ selected ] )
193193
dirs, files = xbmcvfs.listdir( originDir )
194194
for file in files:
195195
if file != "index.xml":

resources/lib/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11

22
import sys
33
import os
4-
import xbmc, xbmcaddon
4+
import xbmc, xmbcvfs, xbmcaddon
55

66
ADDON = xbmcaddon.Addon()
77
ADDONID = ADDON.getAddonInfo('id')
88
ADDONVERSION = ADDON.getAddonInfo('version')
99
LANGUAGE = ADDON.getLocalizedString
1010
CWD = ADDON.getAddonInfo('path')
1111
ADDONNAME = ADDON.getAddonInfo('name')
12-
DATAPATH = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('profile'))
12+
DATAPATH = xbmcvfs.translatePath(xbmcaddon.Addon().getAddonInfo('profile'))
1313
DEFAULTPATH = os.path.join( CWD, 'resources' )
1414

1515
def log(txt):
1616
message = u'%s: %s' % (ADDONID, txt)
17-
xbmc.log(msg=message, level=xbmc.LOGDEBUG)
17+
xbmc.log(msg=message, level=xbmc.LOGDEBUG)

resources/lib/rules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ def browse( self, actionPath, ruleNum, match, content = None ):
945945
returnVal = self.browser( self.niceMatchName( match ) )
946946
try:
947947
# Delete any fake node
948-
xbmcvfs.delete( os.path.join( xbmc.translatePath( "special://profile" ), "library", self.ltype, "plugin.library.node.editor", "temp.xml" ) )
948+
xbmcvfs.delete( os.path.join( xbmcvfs.translatePath( "special://profile" ), "library", self.ltype, "plugin.library.node.editor", "temp.xml" ) )
949949
except:
950950
print_exc()
951951
self.writeUpdatedRule( actionPath, ruleNum, value = returnVal )
@@ -961,7 +961,7 @@ def niceMatchName( self, match ):
961961

962962
def createBrowseNode( self, content, grouping = None ):
963963
# This function creates a fake node which we'll use for browsing
964-
targetDir = os.path.join( xbmc.translatePath( "special://profile" ), "library", self.ltype, "plugin.library.node.editor" )
964+
targetDir = os.path.join( xbmcvfs.translatePath( "special://profile" ), "library", self.ltype, "plugin.library.node.editor" )
965965
if not os.path.exists( targetDir ):
966966
xbmcvfs.mkdirs( targetDir )
967967
# Create a new etree

0 commit comments

Comments
 (0)