From 4fcd40c7453e8ee34278522976758139e67a93d7 Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Mon, 20 Jan 2014 13:02:29 -0600 Subject: [PATCH 1/3] added version info to logs --- resources/lib/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index bc1814a..2a94547 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -14,7 +14,7 @@ def openSettings(): __Addon.openSettings() def log(message,loglevel=xbmc.LOGNOTICE): - xbmc.log(encode(__addon_id__ + ": " + message),level=loglevel) + xbmc.log(encode(__addon_id__ + "-" + __Addon.getAddonInfo('version') + ": " + message),level=loglevel) def showNotification(message): xbmc.executebuiltin("Notification(" + encode(getString(30010)) + "," + encode(message) + ",4000," + xbmc.translatePath(__Addon.getAddonInfo('path') + "/icon.png") + ")") From 884633073a91e3b95955b6489ee05c579c582175 Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Mon, 20 Jan 2014 13:04:03 -0600 Subject: [PATCH 2/3] version bump --- addon.xml | 2 +- changelog.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/addon.xml b/addon.xml index c3e7668..da1695d 100644 --- a/addon.xml +++ b/addon.xml @@ -1,6 +1,6 @@  + name="XBMC Backup" version="0.4.5" provider-name="robweber"> diff --git a/changelog.txt b/changelog.txt index f334767..35b7a11 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +Version 0.4.5 + +added version info to logs + Version 0.4.4 modified the check for invalid file types From e185ddf1318c6fd2f2b87774219178e7b3bf9df4 Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Thu, 23 Jan 2014 12:47:21 -0600 Subject: [PATCH 3/3] attempted fix for unicode errors on logging --- changelog.txt | 2 ++ resources/lib/utils.py | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 35b7a11..3becb42 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,8 @@ Version 0.4.5 added version info to logs +added try/catch for unicode errors + Version 0.4.4 modified the check for invalid file types diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 2a94547..8d1d1c8 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -29,4 +29,11 @@ def getString(string_id): return __Addon.getLocalizedString(string_id) def encode(string): - return string.encode('UTF-8','replace') + result = '' + + try: + result = string.encode('UTF-8','replace') + except UnicodeDecodeError: + result = 'Unicode Error' + + return result