commit:     a66935abdbccc21e52d51a1ccc7b5849afe4b3c6
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Jul 18 00:07:24 2014 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Jul 18 00:07:24 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=a66935ab

packagerules/rules->PackageRules: append_rule()

minor cleanup / comment

---
 roverlay/packagerules/rules.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/roverlay/packagerules/rules.py b/roverlay/packagerules/rules.py
index 0dd0d3d..9e828d1 100644
--- a/roverlay/packagerules/rules.py
+++ b/roverlay/packagerules/rules.py
@@ -61,7 +61,7 @@ class PackageRules ( 
roverlay.packagerules.abstract.rules.NestedPackageRule ):
                          Defaults to True.
       """
       if self._rules:
-         rule.priority = 1 + max ( rule.priority for rule in self._rules )
+         rule.priority = 1 + max ( self._rules, key=(lambda r: r.priority) )
       else:
          rule.priority = 0
 
@@ -71,8 +71,12 @@ class PackageRules ( 
roverlay.packagerules.abstract.rules.NestedPackageRule ):
          rule.set_logger ( self.logger.getChild ( 'nested' ) )
          rule.prepare()
          # no need to sort self._rules
-         #    self._rules [-1].prio > self._rules [-2].prio
-         #     <=> sorted if self.prepare() has been called before
+         #   len(self._rules) > 1:
+         #     self._rules [-1].prio > self._rules [-2].prio
+         #       <=> sorted if self.prepare() has been called before
+         #   else:
+         #     sorted.
+         #
    # --- end of append_rule (...) ---
 
    def _gen_rules_str ( self, level ):

Reply via email to