minor code fixes based on travis-ci output

This commit is contained in:
Rob Weber 2019-09-30 14:06:50 -05:00
parent a7b9aeb9c1
commit 6dfa4a5520
6 changed files with 16 additions and 16 deletions

View File

@ -1,8 +1,8 @@
import json import json
import utils as utils
import xbmcvfs import xbmcvfs
import xbmc import xbmc
import xbmcgui import xbmcgui
from . import utils as utils
class BackupSetManager: class BackupSetManager:
jsonFile = xbmc.translatePath(utils.data_dir() + "custom_paths.json") jsonFile = xbmc.translatePath(utils.data_dir() + "custom_paths.json")
@ -38,7 +38,7 @@ class BackupSetManager:
def getSets(self): def getSets(self):
#list all current sets by name #list all current sets by name
keys = self.paths.keys() keys = list(self.paths.keys())
keys.sort() keys.sort()
return keys return keys

View File

@ -1,12 +1,12 @@
import xbmc import xbmc
import xbmcgui import xbmcgui
import xbmcvfs import xbmcvfs
import utils as utils
import time import time
import json import json
from . import utils as utils
from datetime import datetime from datetime import datetime
from vfs import XBMCFileSystem,DropboxFileSystem,ZipFileSystem,GoogleDriveFilesystem from .vfs import XBMCFileSystem,DropboxFileSystem,ZipFileSystem,GoogleDriveFilesystem
from progressbar import BackupProgressBar from .progressbar import BackupProgressBar
from resources.lib.guisettings import GuiSettingsManager from resources.lib.guisettings import GuiSettingsManager
from resources.lib.extractor import ZipExtractor from resources.lib.extractor import ZipExtractor
@ -141,7 +141,7 @@ class XbmcBackup:
selectedDirs = self._readBackupConfig(utils.data_dir() + "/custom_paths.json") selectedDirs = self._readBackupConfig(utils.data_dir() + "/custom_paths.json")
#get the set names #get the set names
keys = selectedDirs.keys() keys = list(selectedDirs.keys())
#go through the custom sets #go through the custom sets
for aKey in keys: for aKey in keys:

View File

@ -1,4 +1,4 @@
import utils as utils from . import utils as utils
class ZipExtractor: class ZipExtractor:

View File

@ -1,8 +1,8 @@
import utils as utils
from xml.dom import minidom
from xml.parsers.expat import ExpatError
import json import json
import xbmc,xbmcvfs import xbmc,xbmcvfs
from . import utils as utils
from xml.dom import minidom
from xml.parsers.expat import ExpatError
class GuiSettingsManager: class GuiSettingsManager:
@ -30,11 +30,11 @@ class GuiSettingsManager:
restoreSettings = self.__parseNodes(self.doc.getElementsByTagName('setting')) restoreSettings = self.__parseNodes(self.doc.getElementsByTagName('setting'))
#get a list where the restore setting value != the current value #get a list where the restore setting value != the current value
updateSettings = {k: v for k, v in restoreSettings.items() if (k in currentSettings and currentSettings[k] != v)} updateSettings = {k: v for k, v in list(restoreSettings.items()) if (k in currentSettings and currentSettings[k] != v)}
#go through all the found settings and update them #go through all the found settings and update them
jsonObj = {"jsonrpc":"2.0","id":1,"method":"Settings.SetSettingValue","params":{"setting":"","value":""}} jsonObj = {"jsonrpc":"2.0","id":1,"method":"Settings.SetSettingValue","params":{"setting":"","value":""}}
for anId, aValue in updateSettings.items(): for anId, aValue in list(updateSettings.items()):
utils.log("updating: " + anId + ", value: " + str(aValue)) utils.log("updating: " + anId + ", value: " + str(aValue))
jsonObj['params']['setting'] = anId jsonObj['params']['setting'] = anId

View File

@ -1,5 +1,5 @@
import utils as utils
import xbmcgui import xbmcgui
from . import utils as utils
class BackupProgressBar: class BackupProgressBar:
NONE = 2 NONE = 2

View File

@ -1,4 +1,3 @@
import utils as utils
import xbmc import xbmc
import xbmcvfs import xbmcvfs
import xbmcgui import xbmcgui
@ -6,8 +5,9 @@ import zipfile
import os.path import os.path
import sys import sys
import dropbox import dropbox
from . import utils as utils
from dropbox.files import WriteMode,CommitInfo,UploadSessionCursor from dropbox.files import WriteMode,CommitInfo,UploadSessionCursor
from authorizers import DropboxAuthorizer,GoogleDriveAuthorizer from .authorizers import DropboxAuthorizer,GoogleDriveAuthorizer
class Vfs: class Vfs:
root_path = None root_path = None
@ -417,7 +417,7 @@ class GoogleDriveFilesystem(Vfs):
if(file.endswith('/')): if(file.endswith('/')):
file = file[:-1] file = file[:-1]
if(self.history.has_key(file)): if(file in self.history):
result = self.history[file] result = self.history[file]
else: else: