def getDistroDevelSeries(self, distribution):
- """Since distribution.currentseries hits the DB every time, cache it."""
+ """distribution.currentseries hits the DB every time so cache it.""" self._distro_series_map = {}
try:
return self._distro_series_map[distribution]
except KeyError:
result = distribution.currentseries self._distro_series_map[distribution] = result
return result
I think your change doesn't describe what the code does... but that's
because the code is broken! The following line is the culprit:
self._distro_series_map = {}
Every time the method is called the cache gets reset. I think this
line can be removed.
[2]
+ self.branch = self.development_focus_branch
development_focus_branch is a cachedproperty, so perhaps branch should
be a property so that development_focus_branch is not computed until
it is needed.
+ <div tal:condition="not:view/new_branches_are_private" id="privacy-text">
+ <p>
+ New branches you create for <tal:name replace="context/displayname"/>
+ are <strong>public</strong> initially.
+ </p>
+ </div>
+ <div tal:condition="view/new_branches_are_private" id="privacy-text">
+ <p>
+ New branches you create for <tal:name replace="context/displayname"/>
+ are <strong>private</strong> initially.
+ </p>
+ </div>
The tal:condition could go on the subordinate <p> tags, then there's
only one <div>.
[7]
+ <tal:comment condition="nothing">
+ The view/*_count|nothing expressions below are so that this
+ template can be rendered by a view that does not have count
+ information available.
+ </tal:comment>
There aren't any view/*_count|nothing expressions, so this comment can
go.
[8]
+ configured = sum([1 for v in config_statuses.values() if v])
Cool branch :)
The comments I have are all really minor.
Gavin.
[1]
def getDistroDevelS eries(self, distribution): currentseries hits the DB every time, cache it.""" .currentseries hits the DB every time so cache it."""
self. _distro_ series_ map = {} series_ map[distributio n] currentseries
self. _distro_ series_ map[distributio n] = result
- """Since distribution.
+ """distribution
try:
return self._distro_
except KeyError:
result = distribution.
return result
I think your change doesn't describe what the code does... but that's
because the code is broken! The following line is the culprit:
Every time the method is called the cache gets reset. I think this
line can be removed.
[2]
+ self.branch = self.developmen t_focus_ branch
development_ focus_branch is a cachedproperty, so perhaps branch should focus_branch is not computed until
be a property so that development_
it is needed.
[3]
+ self.assertEqua l(None, find_tag_ by_id(contents, 'branch-portlet')) qual(None, find_tag_ by_id(contents, 'branch-portlet'))
...
+ self.assertNotE
I think this (and others that test against None) should be done with
assertIs(None, ...). Can't remember what difference is makes though :)
[4]
+ def test_portlets_ shown_for_ EXTERNAL( self):
+ # If the BranchUsage is HOSTED then the portlets are shown.
s/HOSTED/EXTERNAL/
[5]
+ <a tal:attributes= "href view/mirror_ location" ><tal:mirror replace= "view/mirror_ location" /></a>.
Doesn't really matter, but it might be clearer expressed as:
<a tal:attributes= "href view/mirror_ location"
tal: content= "view/mirror_ location" />.
[6]
+ <div tal:condition= "not:view/ new_branches_ are_private" id="privacy-text"> "context/ displayname" /> public< /strong> initially. "view/new_ branches_ are_private" id="privacy-text"> "context/ displayname" /> private< /strong> initially.
+ <p>
+ New branches you create for <tal:name replace=
+ are <strong>
+ </p>
+ </div>
+ <div tal:condition=
+ <p>
+ New branches you create for <tal:name replace=
+ are <strong>
+ </p>
+ </div>
The tal:condition could go on the subordinate <p> tags, then there's
only one <div>.
[7]
+ <tal:comment condition= "nothing" > count|nothing expressions below are so that this
+ The view/*_
+ template can be rendered by a view that does not have count
+ information available.
+ </tal:comment>
There aren't any view/*_ count|nothing expressions, so this comment can
go.
[8]
+ configured = sum([1 for v in config_ statuses. values( ) if v])
Don't need the list comprehension.