198 |
|
|
199 |
|
|
200 |
def open_url(url): |
def open_url(url): |
201 |
with urllib.request.urlopen(url) as response: |
with urllib.request.urlopen(url) as req: |
202 |
data = response.read() |
#data = response.read() |
203 |
return data |
#return data |
204 |
|
charset=req.info().get_content_charset() |
205 |
|
content=req.read().decode(charset) |
206 |
|
return content |
207 |
|
|
208 |
|
|
209 |
# wraps open url in a catch-all exception handler |
# wraps open url in a catch-all exception handler |
225 |
msg = msg.strip() |
msg = msg.strip() |
226 |
|
|
227 |
if msg != "": |
if msg != "": |
228 |
|
print("[Todic] rootMenu Dialog =" + str(msg)) |
229 |
dialog = xbmcgui.Dialog() |
dialog = xbmcgui.Dialog() |
230 |
dialog.ok('XBMC Todic', msg) |
dialog.ok('XBMC Todic', msg) |
231 |
|
|
415 |
#=================================== Tool Box ======================================= |
#=================================== Tool Box ======================================= |
416 |
# shows a more userfriendly notification |
# shows a more userfriendly notification |
417 |
def showMessage(heading, message): |
def showMessage(heading, message): |
418 |
print( "[Todic::showMessage] " + message) |
print( "[Todic::showMessage] " + str(message) ) |
419 |
print( message ) |
print( message ) |
420 |
duration = 15 * 1000 |
duration = 15 * 1000 |
421 |
xbmc.executebuiltin('XBMC.Notification("%s", "%s", %s)' % |
xbmc.executebuiltin('XBMC.Notification("%s", "%s", %s)' % |
482 |
except: |
except: |
483 |
pass |
pass |
484 |
|
|
485 |
|
print( "[Todic] url=" + str(url)) |
486 |
|
print( "[Todic] name=" + str(name)) |
487 |
|
print( "[Todic] mode=" + str(mode)) |
488 |
|
|
489 |
|
|
490 |
try: |
try: |