zin = zipfile.ZipFile(_in, 'r') except Exception, e: errors += 1; error += '%s\n' % e wiz.log('Error Checking Zip: %s' % str(e), xbmc.LOGERROR) return update, errors, error whitelist = wiz.whiteList('read') for item in whitelist: try: name, id, fold = item except: pass excludes.append(fold) if fold.startswith('pvr'): wiz.setS('pvrclient', id) nFiles = float(len(zin.namelist())) zipsize = wiz.convertSize(sum([item.file_size for item in zin.infolist()])) zipit = str(_in).replace('\\', '/').split('/') title = title if not title == None else zipit[-1].replace('.zip', '') for item in zin.infolist(): count += 1; prog = int(count / nFiles * 100); size += item.file_size file = str(item.filename).split('/') skip = False line1 = '%s [COLOR %s][B][Erros:%s][/B][/COLOR]' % (title, COLOR2, errors) line2 = '[COLOR %s][B]Arquivo:[/B][/COLOR] [COLOR %s]%s/%s[/COLOR] ' % (COLOR2, COLOR1, count, int(nFiles)) line2 += '[COLOR %s][B]Tamanho:[/B][/COLOR] [COLOR %s]%s/%s[/COLOR]' % (COLOR2, COLOR1, wiz.convertSize(size), zipsize) line3 = '[COLOR %s]%s[/COLOR]' % (COLOR1, item.filename) if item.filename == 'userdata/sources.xml' and KEEPSOURCES == 'true': skip = True elif item.filename == 'userdata/favourites.xml' and KEEPFAVS == 'true': skip = True elif item.filename == 'userdata/profiles.xml' and KEEPPROFILES == 'true': skip = True
error += '%s\n' % e wiz.log('Error Checking Zip: %s' % str(e), xbmc.LOGERROR) return update, errors, error whitelist = wiz.whiteList('read') for item in whitelist: try: name, id, fold = item except: pass excludes.append(fold) if fold.startswith('pvr'): wiz.setS('pvrclient', id) nFiles = float(len(zin.namelist())) zipsize = wiz.convertSize(sum([item.file_size for item in zin.infolist()])) zipit = str(_in).replace('\\', '/').split('/') title = title if not title == None else zipit[-1].replace('.zip', '') for item in zin.infolist(): try: str(item.filename).encode('ascii') except UnicodeDecodeError: continue count += 1 prog = int(count / nFiles * 100) size += item.file_size file = str(item.filename).split('/') skip = False line1 = '%s [COLOR %s][B][Errors:%s][/B][/COLOR]' % (title, COLOR2,
zin = zipfile.ZipFile(_in, 'r') except Exception, e: errors += 1; error += '%s\n' % e wiz.log('Error Checking Zip: %s' % str(e), xbmc.LOGERROR) return update, errors, error whitelist = wiz.whiteList('read') for item in whitelist: try: name, id, fold = item except: pass excludes.append(fold) if fold.startswith('pvr'): wiz.setS('pvrclient', id) nFiles = float(len(zin.namelist())) zipsize = wiz.convertSize(sum([item.file_size for item in zin.infolist()])) zipit = str(_in).replace('\\', '/').split('/') title = title if not title == None else zipit[-1].replace('.zip', '') for item in zin.infolist(): count += 1; prog = int(count / nFiles * 100); size += item.file_size file = str(item.filename).split('/') skip = False line1 = '%s [COLOR %s][B][Errores:%s][/B][/COLOR]' % (title, COLOR2, errors) line2 = '[COLOR %s][B]Archivo:[/B][/COLOR] [COLOR %s]%s/%s[/COLOR] ' % (COLOR2, COLOR1, count, int(nFiles)) line2 += '[COLOR %s][B]Tamano:[/B][/COLOR] [COLOR %s]%s/%s[/COLOR]' % (COLOR2, COLOR1, wiz.convertSize(size), zipsize) line3 = '[COLOR %s]%s[/COLOR]' % (COLOR1, item.filename) if item.filename == 'userdata/sources.xml' and KEEPSOURCES == 'true': skip = True elif item.filename == 'userdata/favourites.xml' and KEEPFAVS == 'true': skip = True elif item.filename == 'userdata/profiles.xml' and KEEPPROFILES == 'true': skip = True