git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ee0903f
)
add some checks, use SkinError exception instead of string
author
Felix Domke
<tmbinc@elitedvb.net>
Sat, 17 Jun 2006 16:50:08 +0000
(16:50 +0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Sat, 17 Jun 2006 16:50:08 +0000
(16:50 +0000)
skin.py
patch
|
blob
|
history
diff --git
a/skin.py
b/skin.py
index a1ce50b3a533438c0c645c1f892f591a41c95e3d..30e8c720188b673fc35895ae09dcc63f1337e414 100644
(file)
--- a/
skin.py
+++ b/
skin.py
@@
-18,6
+18,9
@@
def dump(x, i=0):
from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS
from Tools.Directories import resolveFilename, SCOPE_SKIN, SCOPE_SKIN_IMAGE, SCOPE_FONTS
+class SkinError(str):
+ pass
+
dom_skins = [ ]
def loadSkin(name):
dom_skins = [ ]
def loadSkin(name):
@@
-299,7
+302,7
@@
def readSkin(screen, skin, name, desktop):
try:
attributes = screen[wname].skinAttributes = [ ]
except:
try:
attributes = screen[wname].skinAttributes = [ ]
except:
- raise
st
r("component with name '" + wname + "' was not found in skin of screen '" + name + "'!")
+ raise
SkinErro
r("component with name '" + wname + "' was not found in skin of screen '" + name + "'!")
# assert screen[wname] is not Source
# assert screen[wname] is not Source
@@
-309,10
+312,13
@@
def readSkin(screen, skin, name, desktop):
# get corresponding source
source = screen.get(wsource)
if source is None:
# get corresponding source
source = screen.get(wsource)
if source is None:
- raise
st
r("source '" + wsource + "' was not found in screen '" + name + "'!")
+ raise
SkinErro
r("source '" + wsource + "' was not found in screen '" + name + "'!")
wrender = widget.getAttribute('render')
wrender = widget.getAttribute('render')
+ if not wrender:
+ raise SkinError("you must define a renderer with render= for source '%s'" % (wsource))
+
for converter in elementsWithTag(widget.childNodes, "convert"):
ctype = converter.getAttribute('type')
assert ctype
for converter in elementsWithTag(widget.childNodes, "convert"):
ctype = converter.getAttribute('type')
assert ctype
@@
-344,7
+350,7
@@
def readSkin(screen, skin, name, desktop):
if type == "onLayoutFinish":
screen.onLayoutFinish.append(code)
else:
if type == "onLayoutFinish":
screen.onLayoutFinish.append(code)
else:
- raise
st
r("applet type '%s' unknown!" % type)
+ raise
SkinErro
r("applet type '%s' unknown!" % type)
continue
continue
@@
-358,7
+364,7
@@
def readSkin(screen, skin, name, desktop):
elif widget.tagName == "ePixmap":
w.widget = ePixmap
else:
elif widget.tagName == "ePixmap":
w.widget = ePixmap
else:
- raise
st
r("unsupported stuff : %s" % widget.tagName)
+ raise
SkinErro
r("unsupported stuff : %s" % widget.tagName)
w.skinAttributes = [ ]
collectAttributes(w.skinAttributes, widget, skin_path_prefix)
w.skinAttributes = [ ]
collectAttributes(w.skinAttributes, widget, skin_path_prefix)