Changeset 2c5f4925bdd4…
Parent 28b438180330…
by
Changes to one file · Browse files at 2c5f4925bdd4 Showing diff from parent 28b438180330 Diff from another changeset...
@@ -26,6 +26,8 @@
def panelstyle(**kargs):
kargs['type'] = 'panel'
+ if 'contents' not in kargs:
+ kargs['contents'] = PANEL_DEFAULT
return kargs
def labelstyle(**kargs):
@@ -50,7 +52,7 @@ custom = {}
self.custom = custom
if style is None:
- style = panelstyle(contents=PANEL_DEFAULT)
+ style = panelstyle()
self.csstyle = style
if rev is None:
rev = 'tip'
@@ -93,19 +95,14 @@ args = (rev, style, custom, repo, self.info)
type = style['type']
if type == 'panel':
- if 'contents' not in style:
- style['contents'] = PANEL_DEFAULT
- panel = ChangesetPanel(*args)
- if hasattr(self, 'cache'):
- self.cache[key] = panel
- return panel
+ widget = ChangesetPanel(*args)
elif type == 'label':
- label = ChangesetLabel(*args)
- if hasattr(self, 'cache'):
- self.cache[key] = label
- return label
+ widget = ChangesetLabel(*args)
else:
raise _("unknown 'type': %s") % type
+ if hasattr(self, 'cache'):
+ self.cache[key] = widget
+ return widget
else:
raise _("must be specified 'type' in style")
|
Loading...