Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safely import translatePath #5

Merged
merged 1 commit into from
Oct 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,26 @@
import urllib
import xbmc
import xbmcaddon
import xbmcgui,xbmcplugin
import xbmcgui
import xbmcplugin
import xbmcvfs
import uuid

try:
from xbmcvfs import translatePath
except (ImportError, AttributeError):
from xbmc import translatePath

__addon__ = xbmcaddon.Addon()
__author__ = __addon__.getAddonInfo('author')
__scriptid__ = __addon__.getAddonInfo('id')
__scriptname__ = __addon__.getAddonInfo('name')
__version__ = __addon__.getAddonInfo('version')
__language__ = __addon__.getLocalizedString

__cwd__ = xbmcvfs.translatePath( __addon__.getAddonInfo('path') )
__profile__ = xbmcvfs.translatePath( __addon__.getAddonInfo('profile') )
__temp__ = xbmcvfs.translatePath( os.path.join( __profile__, 'temp', '') )
__cwd__ = translatePath( __addon__.getAddonInfo('path') )
__profile__ = translatePath( __addon__.getAddonInfo('profile') )
__temp__ = translatePath( os.path.join( __profile__, 'temp', '') )

if xbmcvfs.exists(__temp__):
shutil.rmtree(__temp__)
Expand Down