Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

stable csinfo: remove the cache for widgets

The widget cache will be implement in thgstrip.py later.

Changeset be7a2d21a2c3

Parent ce1f821a0e51

by Yuki KODAMA

Changes to 2 files · Browse files at be7a2d21a2c3 Showing diff from parent ce1f821a0e51 Diff from another changeset...

 
22
23
24
25
 
26
27
28
 
29
30
31
 
40
41
42
43
 
44
45
46
 
47
48
49
 
57
58
59
60
61
62
63
64
 
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
 
22
23
24
 
25
26
27
 
28
29
30
31
 
40
41
42
 
43
44
45
 
46
47
48
49
 
57
58
59
 
 
60
61
62
 
86
87
88
 
 
 
 
 
 
 
 
 
 
 
89
90
91
92
93
94
 
 
95
96
97
@@ -22,10 +22,10 @@
 PANEL_DEFAULT = ('rev', 'summary', 'user', 'date', 'branch', 'tags')    def create(repo, target=None, style=None, custom=None, **kargs): - return CachedFactory(repo, custom, style, target, **kargs)() + return Factory(repo, custom, style, target, **kargs)()    def factory(*args, **kargs): - return CachedFactory(*args, **kargs) + return Factory(*args, **kargs)    def panelstyle(**kargs):   kargs['type'] = 'panel' @@ -40,10 +40,10 @@
 def custom(**kargs):   return kargs   -class CachedFactory(object): +class Factory(object):     def __init__(self, repo, custom=None, style=None, target=None, - withupdate=False, widgetcache=False): + withupdate=False):   if repo is None:   raise _('must be specified repository')   self.repo = repo @@ -57,8 +57,6 @@
  self.info = CachedSummaryInfo()     self.withupdate = withupdate - if widgetcache: - self.cache = {}     def __call__(self, target=None, style=None, custom=None, repo=None):   # try to create a context object @@ -88,25 +86,12 @@
  type = style['type']   assert type in ('panel', 'label')   - # check widgets cache - if target is None or repo is None: - key = None - else: - key = type + str(target) + str(style) + str(custom) + repo.root - if hasattr(self, 'cache') and key: - try: - return self.cache[key] - except KeyError: - pass -   # create widget   args = (target, style, custom, repo, self.info)   if type == 'panel':   widget = SummaryPanel(*args)   else:   widget = SummaryLabel(*args) - if hasattr(self, 'cache') and key: - self.cache[key] = widget   if self.withupdate:   widget.update()   return widget
 
127
128
129
130
 
131
132
133
 
127
128
129
 
130
131
132
133
@@ -127,7 +127,7 @@
  self.allbtn.connect('clicked', lambda b: self.preview(limit=False))     # csetinfo factory - self.factory = csinfo.factory(repo, withupdate=True, widgetcache=True) + self.factory = csinfo.factory(repo, withupdate=True)   self.lstyle = csinfo.labelstyle(contents=('%(revnum)s:',   ' %(branch)s', ' %(tags)s', ' %(summary)s'))   self.pstyle = csinfo.panelstyle()