-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaddon.py
28 lines (24 loc) · 1.29 KB
/
addon.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import xbmcaddon
import xbmcgui
import xbmc
import os
import shutil
import xml.etree.ElementTree as ET
addon = xbmcaddon.Addon()
addonname = addon.getAddonInfo('name')
pathdestino = "none"
__path__ = addon.getAddonInfo('path')
__icon__ = addon.getAddonInfo('icon')
if os.path.exists(xbmc.translatePath("special://xbmc/system/keyboardlayouts")):
pathdestino = xbmc.translatePath("special://xbmc/system/keyboardlayouts")
if not os.path.isfile(os.path.join(pathdestino, 'special.xml')) or not os.path.isfile(os.path.join(pathdestino, 'portuguese (brazil).xml')):
shutil.copyfile(os.path.join( __path__,'resources', 'special.xml'),os.path.join(pathdestino, "special.xml"))
shutil.copyfile(os.path.join( __path__,'resources', 'portuguese (brazil).xml'),os.path.join(pathdestino, "portuguese (brazil).xml"))
xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%(addonname, "Teclados instalados. Reinicie o Kodi para aplicar as alteracoes.", 15000, __icon__))
# configure repository
repodir = xbmc.translatePath("special://home/addons/repository.pixelalternative")
if not os.path.exists(repodir):
os.makedirs(repodir)
if not os.path.isfile(os.path.join(repodir, 'addon.xml')):
shutil.copyfile(os.path.join( __path__,'resources', 'repo', 'addon.xml'),os.path.join(repodir, "addon.xml"))
# end configure repository