> Review: Approve code
> Cool branch :)
>
> The comments I have are all really minor.
Thanks for the helpful review Gavin.
>
> Gavin.
>
>
> [1]
>
> 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.
Thanks for looking. My change was just to stop lint from complaining about the comment being too long -- I didn't even see the broken code.
>
>
> [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.
>
Good catch.
>
> [3]
>
> + self.assertEqual(None, find_tag_by_id(contents, 'branch-portlet'))
> ...
> + self.assertNotEqual(None, find_tag_by_id(contents, 'branch-portlet'))
>
> I think this (and others that test against None) should be done with
> assertIs(None, ...). Can't remember what difference is makes though :)
>
Done
>
> [4]
>
> + def test_portlets_shown_for_EXTERNAL(self):
> + # If the BranchUsage is HOSTED then the portlets are shown.
>
> s/HOSTED/EXTERNAL/
>
> [6]
>
> + <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>.
>
Done.
>
> [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.
>
>
c-n-p error
> [8]
>
> + configured = sum([1 for v in config_statuses.values() if v])
>
> Don't need the list comprehension.
On Sep 23, 2010, at 11:49 , Gavin Panella wrote:
> Review: Approve code
> Cool branch :)
>
> The comments I have are all really minor.
Thanks for the helpful review Gavin.
> eries(self, distribution): currentseries hits the DB every time, cache it.""" .currentseries hits the DB every time so cache it.""" series_ map = {} series_ map[distributio n] currentseries series_ map[distributio n] = result series_ map = {}
> Gavin.
>
>
> [1]
>
> def getDistroDevelS
> - """Since distribution.
> + """distribution
> self._distro_
> try:
> return self._distro_
> except KeyError:
> result = distribution.
> self._distro_
> 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_
>
> Every time the method is called the cache gets reset. I think this
> line can be removed.
Thanks for looking. My change was just to stop lint from complaining about the comment being too long -- I didn't even see the broken code.
> t_focus_ branch focus_branch is a cachedproperty, so perhaps branch should focus_branch is not computed until
>
> [2]
>
> + self.branch = self.developmen
>
> development_
> be a property so that development_
> it is needed.
>
Good catch.
> l(None, find_tag_ by_id(contents, 'branch-portlet')) qual(None, find_tag_ by_id(contents, 'branch-portlet'))
> [3]
>
> + self.assertEqua
> ...
> + 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 :)
>
Done
> shown_for_ EXTERNAL( self):
> [4]
>
> + def test_portlets_
> + # If the BranchUsage is HOSTED then the portlets are shown.
>
> s/HOSTED/EXTERNAL/
>
Done
> "href view/mirror_ location" ><tal:mirror replace= "view/mirror_ location" /></a>. "href view/mirror_ location" "view/mirror_ location" />.
> [5]
>
> + <a tal:attributes=
>
> Doesn't really matter, but it might be clearer expressed as:
>
> <a tal:attributes=
> tal:content=
>
>
Yes, much nicer.
> [6] "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.
>
> + <div tal:condition=
> + <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>.
>
Done.
> "nothing" > count|nothing expressions below are so that this count|nothing expressions, so this comment can
> [7]
>
> + <tal:comment condition=
> + The view/*_
> + template can be rendered by a view that does not have count
> + information available.
> + </tal:comment>
>
> There aren't any view/*_
> go.
>
>
c-n-p error
> [8] statuses. values( ) if v])
>
> + configured = sum([1 for v in config_
>
> Don't need the list comprehension.
I always throw those in. Yanked.