Changeset 7ec08aebefb6…
Parent fb14d984fbce…
by
Changes to one file · Browse files at 7ec08aebefb6 Showing diff from parent fb14d984fbce Diff from another changeset...
@@ -55,7 +55,7 @@ if style is None:
style = panelstyle()
self.csstyle = style
- self.info = CachedSummaryInfo()
+ self.info = SummaryInfo()
self.withupdate = withupdate
@@ -413,54 +413,6 @@ pass
return default_func(widget, item, markups)
-class CachedSummaryInfo(SummaryInfo):
-
- def __init__(self):
- SummaryInfo.__init__(self)
- self.clear_cache()
-
- def try_cache(self, target, func, *args, **kargs):
- item, widget, ctx, custom = args
- if target != 'widget': # no cache for widget
- root = ctx._repo.root
- repoid = id(ctx._repo)
- try:
- cacheinfo = self.cache[root]
- if cacheinfo[0] != repoid:
- del self.cache[root] # clear cache
- cacheinfo = None
- except KeyError:
- cacheinfo = None
- if cacheinfo is None:
- self.cache[root] = cacheinfo = (repoid, {})
- revid = ctx.hex()
- if not revid and hasattr(ctx, '_path'):
- revid = ctx._path
- key = target + item + revid + str(custom)
- try:
- return cacheinfo[1][key]
- except KeyError:
- pass
- value = func(self, *args, **kargs)
- if target != 'widget': # do not cache widgets
- cacheinfo[1][key] = value
- return value
-
- def get_data(self, *args, **kargs):
- return self.try_cache('data', SummaryInfo.get_data, *args, **kargs)
-
- def get_label(self, *args, **kargs):
- return self.try_cache('label', SummaryInfo.get_label, *args, **kargs)
-
- def get_markup(self, *args, **kargs):
- return self.try_cache('markup', SummaryInfo.get_markup, *args, **kargs)
-
- def get_widget(self, *args, **kargs):
- return self.try_cache('widget', SummaryInfo.get_widget, *args, **kargs)
-
- def clear_cache(self):
- self.cache = {}
-
class SummaryBase(object):
def __init__(self, target, custom, repo, info):
@@ -547,13 +499,6 @@# self.set_label(label)
# self.set_shadow_type(gtk.SHADOW_ETCHED_IN)
-# if 'padding' in self.csstyle:
-# padding = self.csstyle['padding']
- # 'border' range is 0-65535
-# assert isinstance(padding, (int, long))
-# assert 0 <= padding and padding <= 65535
-# self.table.set_border_width(padding)
-
# build info
contents = self.csstyle.get('contents', ())
|
Loading...