Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update screensaver.py #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions screensaver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
# COLLECTION = ADDON.getSetting("Collection").encode("utf-8")
ANIMATION = 'nope' #if ADDON.getSetting("Animate") == 'true' else 'nope'
TIME = 'okay' #if ADDON.getSetting("Time") == 'true' else 'nope'
TIMER = 10 #[30,60,120,240][int(ADDON.getSetting("RotateTime"))]
# TIMER = 10 #[30,60,120,240][int(ADDON.getSetting("RotateTime"))]
# KEYWORDS = urllib.quote(ADDON.getSetting("Keywords").encode("utf-8"))
# RES = ['1280x720','1920x1080','3840x2160'][int(ADDON.getSetting("Resolution"))]
RES = ['1280x720','1920x1080','3840x2160'][int(ADDON.getSetting("Resolution"))]
# PHOTO_TYPE = ['featured','random','user','collection'][int(ADDON.getSetting("PhotoType"))]

# URL_PARAMS = '/%s'%PHOTO_TYPE
Expand Down Expand Up @@ -60,7 +60,7 @@ def loadLinks(self):
def setImage(self, id):
self.log("loading... image")
self.openURL(random.choice(self.imageLinks), id)
self.log("image downloaded")
#self.log("image downloaded")
# image = image if len(image) > 0 else self.openURL(IMAGE_URL)
filepath = os.path.join(BASE_PATH, "image" + str(id) + ".jpg")
if xbmcvfs.exists(filepath):
Expand Down Expand Up @@ -107,7 +107,7 @@ def openURL(self, url, id):
# url = page.geturl()
# self.log("openURL return url = " + url)
# return r.content
# except urllib2.URLError, e: self.log("openURL Failed! " + str(e), xbmc.LOGERROR)
except urllib2.URLError, e: self.log("openURL Failed! " + str(e), xbmc.LOGERROR)
# except socket.timeout, e: self.log("openURL Failed! " + str(e), xbmc.LOGERROR)
except Exception,e:
self.log("connection failed! " + str(e), xbmc.LOGERROR)
Expand All @@ -116,4 +116,4 @@ def openURL(self, url, id):
if __name__ == '__main__':
ui = GUI("default.xml", ADDON_PATH, "default")
ui.doModal()
del ui
del ui