Merge branch '1.6.0_fixes'

This commit is contained in:
Rob Weber 2019-12-04 11:49:35 -06:00
commit 7c23c17e33
8 changed files with 12 additions and 16 deletions

View File

@ -10,5 +10,5 @@ before_script:
# command to run our tests
script:
- flake8 ./ --statistics --show-source --ignore=E501,E722 --exclude=croniter.py,relativedelta.py,*/dropbox/* # check python structure against flake8 tests, ignore long lines
- flake8 ./ --statistics --show-source --builtins=sys --ignore=E501,E722 --exclude=croniter.py,relativedelta.py,*/dropbox/* # check python structure against flake8 tests, ignore long lines
- kodi-addon-checker --branch=matrix --allow-folder-id-mismatch

View File

@ -80,12 +80,10 @@
<description lang="sk_SK">Už ste niekedy poškodili konfiguráciu Kodi a priali si mať zálohu? Teraz môžete - na jeden klik. Môžete exportovať Vašu databázu, playlist, náhľady, doplnky a konfigurácie na ktorýkoľvek zdroj zapisovateľný Kodi. Zálohy môžu byť púšťané na požiadanie alebo plánovačom. </description>
<description lang="sv_SE">Har du någonsin tappat bort din Kodi konfiguration och önskat att du hade en backup? Nu kan du enkelt med ett klick. Du kan exportera din databas, spellista, minityrer, tillägg och andra konfigurationsdetaljer till valfri källa som är skrivbar för Kodi. Backupper kan köras på begäran eller via scheman.</description>
<description lang="zh_CN">你是否经常折腾你的 Kodi因而希望能够有个备份你可以把资料库、播放列表、缩略图、插件和其他配置细节导出到 Kodi 可以写入的任意位置。备份可以按需运行或通过计划任务执行。</description>
<language></language>
<platform>all</platform>
<license>The MIT License</license>
<license>MIT</license>
<forum>https://forum.kodi.tv/showthread.php?tid=129499</forum>
<source>https://github.com/robweber/xbmcbackup</source>
<email></email>
<assets>
<icon>resources/images/icon.png</icon>
<screenshot>resources/images/screenshot1.png</screenshot>

View File

@ -1,4 +1,3 @@
import sys
import xbmc
import xbmcgui
import resources.lib.utils as utils

View File

View File

@ -2,6 +2,7 @@ import json
import xbmc
import xbmcgui
import xbmcvfs
import os.path
from . import utils as utils
@ -180,14 +181,14 @@ class AdvancedBackupEditor:
while(exitCondition != -1):
# load the custom paths
listItem = xbmcgui.ListItem(utils.getString(30126), '')
listItem.setArt({'icon': utils.addon_dir() + 'resources/images/plus-icon.png'})
listItem.setArt({'icon': os.path.join(utils.addon_dir(), 'resources', 'images', 'plus-icon.png')})
options = [listItem]
for index in range(0, len(customPaths.getSets())):
aSet = customPaths.getSet(index)
listItem = xbmcgui.ListItem(aSet['name'], utils.getString(30121) + ': ' + aSet['set']['root'])
listItem.setArt({'icon': utils.addon_dir() + 'resources/images/folder-icon.png'})
listItem.setArt({'icon': os.path.join(utils.addon_dir(), 'resources', 'images', 'folder-icon.png')})
options.append(listItem)
# show the gui
@ -226,7 +227,7 @@ class AdvancedBackupEditor:
shouldContinue = self.dialog.yesno(utils.getString(30139), utils.getString(30140), utils.getString(30141))
if(shouldContinue):
source = xbmc.translatePath(utils.addon_dir() + "/resources/data/default_files.json")
dest = xbmc.translatePath(utils.data_dir() + "/custom_paths.json")
source = xbmc.translatePath(os.path.join(utils.addon_dir(), 'resources', 'data', 'default_files.json'))
dest = xbmc.translatePath(os.path.join(utils.data_dir(), 'custom_paths.json'))
xbmcvfs.copy(source, dest)

View File

@ -524,14 +524,12 @@ class XbmcBackup:
return result
def _createResumeBackupFile(self):
rFile = xbmcvfs.File(xbmc.translatePath(utils.data_dir() + "resume.txt"), 'w')
rFile.write(self.restore_point)
rFile.close()
with xbmcvfs.File(xbmc.translatePath(utils.data_dir() + "resume.txt"), 'w') as f:
f.write(self.restore_point)
def _readBackupConfig(self, aFile):
jFile = xbmcvfs.File(xbmc.translatePath(aFile), 'r')
jsonString = jFile.read()
jFile.close()
with xbmcvfs.File(xbmc.translatePath(aFile), 'r') as f:
jsonString = f.read()
return json.loads(jsonString)

View File

@ -9,4 +9,4 @@ def shorten(aUrl):
data = req.read()
# should be a tiny url
return str(data)
return data