From: "Slava Bacherikov" <slava@bacherikov.org.ua>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/apps/packages/, gpackages/libs/package_info/
Date: Thu, 12 Jul 2012 22:16:25 +0000 (UTC) [thread overview]
Message-ID: <1342024554.454459bd91a8e8664376e0cacd21ec473cdc4a56.bacher09@gentoo> (raw)
commit: 454459bd91a8e8664376e0cacd21ec473cdc4a56
Author: Slava Bacherikov <slava <AT> bacher09 <DOT> org>
AuthorDate: Wed Jul 11 16:35:54 2012 +0000
Commit: Slava Bacherikov <slava <AT> bacherikov <DOT> org <DOT> ua>
CommitDate: Wed Jul 11 16:35:54 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-packages.git;a=commit;h=454459bd
Add cia.vc links for MaintainerModel
---
gpackages/apps/packages/models.py | 11 ++++++++++-
gpackages/libs/package_info/utils.py | 12 ++++++++++++
2 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/gpackages/apps/packages/models.py b/gpackages/apps/packages/models.py
index b90049f..c7ee65f 100644
--- a/gpackages/apps/packages/models.py
+++ b/gpackages/apps/packages/models.py
@@ -1,6 +1,7 @@
from django.db import models
from package_info.abstract import AbstractCategory, AbstarctPackage, \
AbstractEbuild, AbstractNewsItem
+from package_info.utils import ciavc_link, email_parse
import managers
from package_info.generic import get_from_kwargs_and_del
from package_info.generic_metadata.repo_const import REPOS_TYPE
@@ -272,7 +273,15 @@ class MaintainerModel(StatsModel, AbstractDateTimeModel):
def check_or_need_update(self, maintainer):
return not (self.name == maintainer.name and \
self.email == maintainer.email)
-
+
+ @property
+ def ciavc_link(self):
+ return ciavc_link(self.email_name)
+
+ @property
+ def email_name(self):
+ return email_parse(self.email)[0]
+
def __unicode__(self):
return ':'.join((unicode(self.name), self.email))
diff --git a/gpackages/libs/package_info/utils.py b/gpackages/libs/package_info/utils.py
new file mode 100644
index 0000000..934b263
--- /dev/null
+++ b/gpackages/libs/package_info/utils.py
@@ -0,0 +1,12 @@
+ciavc_author_template = 'http://cia.vc/stats/author/%s/'
+def ciavc_link(name):
+ return ciavc_author_template % name
+
+def email_parse(email):
+ e_l = email.split('@')
+ if len(e_l) == 1:
+ return (e_l[0], '')
+ elif len(e_l) > 1:
+ return (e_l[0], e_l[1])
+ else:
+ return ('','')
next reply other threads:[~2012-07-12 22:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 22:16 Slava Bacherikov [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-08-11 22:30 [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/apps/packages/, gpackages/libs/package_info/ Slava Bacherikov
2012-08-02 22:44 Slava Bacherikov
2012-07-05 23:27 Slava Bacherikov
2012-07-03 21:08 Slava Bacherikov
2012-07-02 22:25 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=1342024554.454459bd91a8e8664376e0cacd21ec473cdc4a56.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