public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/overlay/
Date: Fri, 18 Jul 2014 16:20:01 +0000 (UTC)	[thread overview]
Message-ID: <1405624461.093b182951ad7ab6eb7e519061c7b95dc218aacb.dywi@gentoo> (raw)

commit:     093b182951ad7ab6eb7e519061c7b95dc218aacb
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jul 17 19:14:21 2014 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jul 17 19:14:21 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=093b1829

overlay/abccontrol: convert_str()

---
 roverlay/overlay/abccontrol.py | 42 +++++++++++++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 11 deletions(-)

diff --git a/roverlay/overlay/abccontrol.py b/roverlay/overlay/abccontrol.py
index 364a083..d031eec 100644
--- a/roverlay/overlay/abccontrol.py
+++ b/roverlay/overlay/abccontrol.py
@@ -82,17 +82,37 @@ class AdditionControlResult ( object ):
    ) = _gen_bits(5)
 
 
-#   PKG_DESCRIPTION_MAP      = {
-#      PKG_FORCE_DENY           : 'force-deny',
-#      PKG_DENY_REPLACE         : 'deny-replace',
-#      PKG_FORCE_REPLACE        : 'force-replace',
-#      PKG_REPLACE_ONLY         : 'replace-only',
-#      PKG_REVBUMP_ON_COLLISION : 'revbump-on-collision',
-#      PKG_DEFAULT_BEHAVIOR     : 'default',
-#   }
-#
-#   PKG_DESCRIPTION_REVMAP   = { v: k for k,v in PKG_DESCRIPTION_MAP.items() }
-#
+   PKG_DESCRIPTION_MAP      = {
+      PKG_FORCE_DENY           : 'force-deny',
+      PKG_DENY_REPLACE         : 'deny-replace',
+      PKG_FORCE_REPLACE        : 'force-replace',
+      PKG_REPLACE_ONLY         : 'replace-only',
+      PKG_REVBUMP_ON_COLLISION : 'revbump-on-collision',
+      PKG_DEFAULT_BEHAVIOR     : 'default',
+   }
+
+   PKG_DESCRIPTION_REVMAP   = { v: k for k,v in PKG_DESCRIPTION_MAP.items() }
+
+   @classmethod
+   def convert_str ( cls, s ):
+      desc_rmap = cls.PKG_DESCRIPTION_REVMAP
+
+      if not s:
+         raise ValueError ( "str must not be empty." )
+
+      bitmask = 0
+
+      for arg in filter ( None, s.strip().lower().split(",") ):
+         # ^ strip(),lower(),split() ...
+         print(arg)
+         try:
+            bitmask |= desc_rmap [arg]
+         except KeyError:
+            raise ValueError ( arg )
+      # -- end for
+
+      return bitmask
+   # --- end of convert_str (...) ---
 
    @classmethod
    def get_reversed_sort_key ( cls, k ):


WARNING: multiple messages have this Message-ID (diff)
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:wip/addition_control commit in: roverlay/overlay/
Date: Thu, 17 Jul 2014 20:12:29 +0000 (UTC)	[thread overview]
Message-ID: <1405624461.093b182951ad7ab6eb7e519061c7b95dc218aacb.dywi@gentoo> (raw)
Message-ID: <20140717201229.xifLSCcmNUvwPTzzBUTgqhTxVLhJikzRHaOMxPBBSKM@z> (raw)

commit:     093b182951ad7ab6eb7e519061c7b95dc218aacb
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jul 17 19:14:21 2014 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jul 17 19:14:21 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=093b1829

overlay/abccontrol: convert_str()

---
 roverlay/overlay/abccontrol.py | 42 +++++++++++++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 11 deletions(-)

diff --git a/roverlay/overlay/abccontrol.py b/roverlay/overlay/abccontrol.py
index 364a083..d031eec 100644
--- a/roverlay/overlay/abccontrol.py
+++ b/roverlay/overlay/abccontrol.py
@@ -82,17 +82,37 @@ class AdditionControlResult ( object ):
    ) = _gen_bits(5)
 
 
-#   PKG_DESCRIPTION_MAP      = {
-#      PKG_FORCE_DENY           : 'force-deny',
-#      PKG_DENY_REPLACE         : 'deny-replace',
-#      PKG_FORCE_REPLACE        : 'force-replace',
-#      PKG_REPLACE_ONLY         : 'replace-only',
-#      PKG_REVBUMP_ON_COLLISION : 'revbump-on-collision',
-#      PKG_DEFAULT_BEHAVIOR     : 'default',
-#   }
-#
-#   PKG_DESCRIPTION_REVMAP   = { v: k for k,v in PKG_DESCRIPTION_MAP.items() }
-#
+   PKG_DESCRIPTION_MAP      = {
+      PKG_FORCE_DENY           : 'force-deny',
+      PKG_DENY_REPLACE         : 'deny-replace',
+      PKG_FORCE_REPLACE        : 'force-replace',
+      PKG_REPLACE_ONLY         : 'replace-only',
+      PKG_REVBUMP_ON_COLLISION : 'revbump-on-collision',
+      PKG_DEFAULT_BEHAVIOR     : 'default',
+   }
+
+   PKG_DESCRIPTION_REVMAP   = { v: k for k,v in PKG_DESCRIPTION_MAP.items() }
+
+   @classmethod
+   def convert_str ( cls, s ):
+      desc_rmap = cls.PKG_DESCRIPTION_REVMAP
+
+      if not s:
+         raise ValueError ( "str must not be empty." )
+
+      bitmask = 0
+
+      for arg in filter ( None, s.strip().lower().split(",") ):
+         # ^ strip(),lower(),split() ...
+         print(arg)
+         try:
+            bitmask |= desc_rmap [arg]
+         except KeyError:
+            raise ValueError ( arg )
+      # -- end for
+
+      return bitmask
+   # --- end of convert_str (...) ---
 
    @classmethod
    def get_reversed_sort_key ( cls, k ):


             reply	other threads:[~2014-07-18 16:20 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18 16:20 André Erdmann [this message]
2014-07-17 20:12 ` [gentoo-commits] proj/R_overlay:wip/addition_control commit in: roverlay/overlay/ André Erdmann
  -- strict thread matches above, loose matches on Subject: below --
2014-08-23 19:03 [gentoo-commits] proj/R_overlay:master " André Erdmann
2014-07-29 18:29 ` André Erdmann
2014-07-18  2:28 [gentoo-commits] proj/R_overlay:wip/addition_control " André Erdmann
2014-07-18 16:20 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2014-07-18  2:28 [gentoo-commits] proj/R_overlay:wip/addition_control " André Erdmann
2014-07-18 16:20 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2014-04-01 16:38 André Erdmann
2013-09-18 14:00 André Erdmann
2013-09-17 13:49 André Erdmann
2013-09-03 15:51 André Erdmann
2013-09-03 13:15 André Erdmann
2013-09-03  8:35 André Erdmann
2013-09-02 16:21 André Erdmann
2013-09-02 16:21 André Erdmann
2013-08-29 12:36 André Erdmann
2013-08-20 21:46 André Erdmann
2013-08-20 21:46 André Erdmann
2013-07-29 14:56 André Erdmann
2013-07-10 15:10 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-07-10 16:16 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-06-22 15:24 André Erdmann
2013-06-18 14:12 André Erdmann
2013-06-13 16:34 André Erdmann
2013-04-25 16:44 André Erdmann
2013-04-25 16:44 André Erdmann
2013-02-09 21:28 André Erdmann
2013-02-09 20:45 André Erdmann
2013-02-09 20:45 André Erdmann
2013-01-30 20:16 André Erdmann
2012-08-17 17:26 André Erdmann
2012-08-03 13:38 André Erdmann
2012-08-01 21:10 André Erdmann
2012-07-30 15:53 André Erdmann
2012-07-30  8:52 André Erdmann
2012-07-30  8:52 André Erdmann
2012-07-24 16:59 [gentoo-commits] proj/R_overlay:overlay_wip " André Erdmann
2012-07-30  8:52 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2012-07-05 16:00 André Erdmann
2012-07-04 18:21 André Erdmann
2012-07-03 17:48 André Erdmann
2012-06-27 14:46 André Erdmann
2012-06-26 15:42 André Erdmann
2012-06-22 18:13 André Erdmann
2012-06-21 16:55 André Erdmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405624461.093b182951ad7ab6eb7e519061c7b95dc218aacb.dywi@gentoo \
    --to=dywi@mailerd.de \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox