Added verbose logging setting

modified vfs.py to filter out compressed files that xbmc treats as directories by default
This commit is contained in:
robweber 2012-07-18 10:27:00 -05:00
parent acb1bb2de3
commit 7b582072bd
4 changed files with 13 additions and 3 deletions

View File

@ -8,7 +8,8 @@ class FileManager:
walk_path = '' walk_path = ''
addonDir = '' addonDir = ''
fileArray = None fileArray = None
verbose_log = False
def __init__(self,path,addon_dir): def __init__(self,path,addon_dir):
self.walk_path = path self.walk_path = path
self.addonDir = addon_dir self.addonDir = addon_dir
@ -19,7 +20,8 @@ class FileManager:
def createFileList(self,Addon): def createFileList(self,Addon):
self.fileArray = [] self.fileArray = []
self.verbose_log = Addon.getSetting("verbose_log") == 'true'
#figure out which syncing options to run #figure out which syncing options to run
if(Addon.getSetting('backup_addons') == 'true'): if(Addon.getSetting('backup_addons') == 'true'):
self.addFile("-addons") self.addFile("-addons")
@ -69,6 +71,8 @@ class FileManager:
def addFile(self,filename): def addFile(self,filename):
#write the full remote path name of this file #write the full remote path name of this file
if(self.verbose_log):
xbmc.log("Add File: " + filename)
self.fileArray.append(filename) self.fileArray.append(filename)
def getFileList(self): def getFileList(self):

View File

@ -10,6 +10,7 @@
<string id="30023">Mode</string> <string id="30023">Mode</string>
<string id="30024">Type Remote Path</string> <string id="30024">Type Remote Path</string>
<string id="30025">Remote Path Type</string> <string id="30025">Remote Path Type</string>
<string id="30026">Verbose Logging</string>
<string id="30030">User Addons</string> <string id="30030">User Addons</string>
<string id="30031">Addon Data</string> <string id="30031">Addon Data</string>

View File

@ -38,6 +38,8 @@ def walk(path):
current_depth = 0 current_depth = 0
not_dir = ['.zip','.xsp','.rar']
while True: while True:
if current_depth > -1: if current_depth > -1:
@ -48,8 +50,10 @@ def walk(path):
current_dirs, current_files = [], [] current_dirs, current_files = [], []
for x in listdir(current_path, extra_metadata=True): for x in listdir(current_path, extra_metadata=True):
file_ext = x['file'].split('.')[-1]
if x['filetype'] == 'directory' and not x['file'].startswith("zip://"): if x['filetype'] == 'directory' and not any(file_ext in s for s in not_dir):
current_dirs.append(urllib.unquote(x['file'])) current_dirs.append(urllib.unquote(x['file']))

View File

@ -7,6 +7,7 @@
<setting id="remote_path" type="folder" label="30020" visible="eq(-2,0)" /> <setting id="remote_path" type="folder" label="30020" visible="eq(-2,0)" />
<setting id="backup_name" type="text" label="30021" default="xbmc_backup"/> <setting id="backup_name" type="text" label="30021" default="xbmc_backup"/>
<setting id="run_silent" type="bool" label="30022" default="false" /> <setting id="run_silent" type="bool" label="30022" default="false" />
<setting id="verbose_log" type="bool" label="30026" default="false" />
</category> </category>
<category id="selection" label="30012"> <category id="selection" label="30012">
<setting id="backup_addons" type="bool" label="30030" default="true" /> <setting id="backup_addons" type="bool" label="30030" default="true" />