From: "Slava Bacherikov" <slava@bacherikov.org.ua>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/libs/
Date: Sun, 3 Jun 2012 13:19:34 +0000 (UTC) [thread overview]
Message-ID: <1338727578.578144075b13c6e755525dd8565d706baf7d7bff.bacher09@gentoo> (raw)
commit: 578144075b13c6e755525dd8565d706baf7d7bff
Author: Slava Bacherikov <slava <AT> bacher09 <DOT> org>
AuthorDate: Sun Jun 3 12:46:18 2012 +0000
Commit: Slava Bacherikov <slava <AT> bacherikov <DOT> org <DOT> ua>
CommitDate: Sun Jun 3 12:46:18 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-packages.git;a=commit;h=57814407
Changes in herds layer.
---
gpackages/libs/herds.py | 27 ++++++++++++++++++++++++---
1 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/gpackages/libs/herds.py b/gpackages/libs/herds.py
index b1e596b..02d2782 100644
--- a/gpackages/libs/herds.py
+++ b/gpackages/libs/herds.py
@@ -29,6 +29,11 @@ class AbstarctXmlObject(object):
class Maintainer(AbstarctXmlObject, ToStrMixin):
attrs = ('name', 'email', 'role')
+ def __init__(self, *args, **kwargs):
+ super(Maintainer, self).__init__(*args, **kwargs)
+ if self._email is not None:
+ self._email = self._email.lower()
+
def __eq__(self, other):
return self.email == other.email
@@ -47,21 +52,31 @@ class Herd(AbstarctXmlObject, ToStrMixin):
def __init__(self, xml_object):
super(Herd, self).__init__(xml_object)
- self._iter_maintainer = xml_object.iterfind('maintainer')
+ self._xml_object = xml_object
+
+ def __eq__(self, other):
+ return self.name == other.name
+
+ def __ne__(self, other):
+ return self.name != other.name
+
+ def __hash__(self):
+ return hash(self.name)
def iter_mainteiner(self):
- for maintainer_tree in self._iter_maintainer:
+ for maintainer_tree in self._xml_object.iterfind('maintainer'):
yield Maintainer(maintainer_tree)
def __unicode__(self):
return self.name
-class Herds(object):
+class Herds(ToStrMixin):
def __init__(self, herd_path='/usr/portage/metadata/herds.xml'):
self._herd_path = herd_path
self._herd_parse = etree.parse(herd_path)
self._herds_dict = None
+ self._maintainers_dict = None
def iter_herd(self):
for herd_tree in self._herd_parse.iterfind('herd'):
@@ -77,9 +92,15 @@ class Herds(object):
return res
def get_maintainers_with_hers(self):
+ if self._maintainers_dict is not None:
+ return self._maintainers_dict
herd_dict = self.get_herds_indict()
maintainer_dict = defaultdict(list)
for herd in herd_dict.itervalues():
for maintainer in herd.iter_mainteiner():
maintainer_dict[maintainer].append(herd.name)
+ self._maintainers_dict = maintainer_dict
return maintainer_dict
+
+ def __unicode__(self):
+ return self._herd_path
next reply other threads:[~2012-06-03 13:19 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-03 13:19 Slava Bacherikov [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-06-20 23:23 [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/libs/ Slava Bacherikov
2012-06-20 23:23 Slava Bacherikov
2012-06-20 23:23 Slava Bacherikov
2012-06-18 21:26 Slava Bacherikov
2012-06-18 21:26 Slava Bacherikov
2012-06-18 21:26 Slava Bacherikov
2012-06-14 19:10 Slava Bacherikov
2012-06-12 18:34 Slava Bacherikov
2012-06-12 18:34 Slava Bacherikov
2012-06-10 17:51 Slava Bacherikov
2012-06-09 18:19 Slava Bacherikov
2012-06-09 18:19 Slava Bacherikov
2012-06-07 22:48 Slava Bacherikov
2012-06-07 22:48 Slava Bacherikov
2012-06-07 22:48 Slava Bacherikov
2012-06-06 22:48 Slava Bacherikov
2012-06-05 21:46 Slava Bacherikov
2012-06-05 20:48 Slava Bacherikov
2012-06-05 15:49 Slava Bacherikov
2012-06-05 15:49 Slava Bacherikov
2012-06-04 22:18 Slava Bacherikov
2012-06-04 16:16 Slava Bacherikov
2012-06-04 16:16 Slava Bacherikov
2012-06-03 19:34 Slava Bacherikov
2012-06-03 16:19 Slava Bacherikov
2012-06-03 13:19 Slava Bacherikov
2012-06-02 16:04 Slava Bacherikov
2012-06-01 21:28 Slava Bacherikov
2012-06-01 21:28 Slava Bacherikov
2012-05-31 15:28 Slava Bacherikov
2012-05-31 15:28 Slava Bacherikov
2012-05-29 21:34 Slava Bacherikov
2012-05-29 13:38 Slava Bacherikov
2012-05-28 17:00 Slava Bacherikov
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=1338727578.578144075b13c6e755525dd8565d706baf7d7bff.bacher09@gentoo \
--to=slava@bacherikov.org.ua \
--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