forked from phil65/script.extendedinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtils.py
More file actions
28 lines (19 loc) · 654 Bytes
/
Utils.py
File metadata and controls
28 lines (19 loc) · 654 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import urllib, xml.dom.minidom, xbmc
def log(msg):
print ' >> script.extendedinfo: %s' % str(msg)
def GetStringFromUrl(encurl):
f = urllib.urlopen( encurl)
doc = f.read()
f.close()
return str(doc)
def GetValue(node, tag):
v = node.getElementsByTagName(tag)
if len(v) == 0:
return '-'
if len(v[0].childNodes) == 0:
return '-'
return unicode(v[0].childNodes[0].data)
def GetAttribute(node, attr):
v = unicode(node.getAttribute(tag))
def Notify(header, line='', line2='', line3=''):
xbmc.executebuiltin('Notification(%s,%s,%s,%s)' % (header, line, line2, line3) )