public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Slava Bacherikov" <slava@bacherikov.org.ua>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/libs/package_info/package_backends/
Date: Fri, 22 Jun 2012 00:02:14 +0000 (UTC)	[thread overview]
Message-ID: <1340290590.ada7b1719ea4b37d3a9aba0eabad7e7e11d65761.bacher09@gentoo> (raw)

commit:     ada7b1719ea4b37d3a9aba0eabad7e7e11d65761
Author:     Slava Bacherikov <slava <AT> bacher09 <DOT> org>
AuthorDate: Thu Jun 21 14:56:30 2012 +0000
Commit:     Slava Bacherikov <slava <AT> bacherikov <DOT> org <DOT> ua>
CommitDate: Thu Jun 21 14:56:30 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-packages.git;a=commit;h=ada7b171

Add slots and some properties to pkgcore backend

---
 .../libs/package_info/package_backends/pkgcore.py  |   27 +++++++++++++++++--
 1 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/gpackages/libs/package_info/package_backends/pkgcore.py b/gpackages/libs/package_info/package_backends/pkgcore.py
index 1833efd..79e7375 100644
--- a/gpackages/libs/package_info/package_backends/pkgcore.py
+++ b/gpackages/libs/package_info/package_backends/pkgcore.py
@@ -81,6 +81,8 @@ class PortTree(PortTreeMixin):
 
 class Category(CategoryMixin):
     
+    __slots__ = ('_repo_obj', 'name')
+    
     def __init__(self, category_name, repo_obj):
         self._repo_obj = repo_obj
         self.name = category_name
@@ -101,6 +103,8 @@ class Category(CategoryMixin):
         return self._repo_obj._versions[(self.name, package_name)]
 
 class Package(PackageMixin):
+
+    __slots__ = ('name', 'category_obj')
     
     def __init__(self, package_name, category_obj):
         self.name = package_name
@@ -118,12 +122,29 @@ class Package(PackageMixin):
         return '%s/%s' % (self.category_obj.name, self.name)
 
 
+ebuild_prop = lambda var: property(lambda self: getattr(self._ebuild, var))
+
 class Ebuild(EbuildMixin):
     
+    __slots__ = ('_ebuild', 'package_obj')
+
     def __init__(self, ebuild, package_obj):
         self._ebuild = ebuild
         self.package_obj = package_obj
 
-    @property
-    def cpv(self):
-        return self._ebuild.cpvstr
+    ebuild_path = ebuild_prop('path')
+
+    version = ebuild_prop('version')
+
+    revision = ebuild_prop('revision')
+
+    fullversion = ebuild_prop('fullver')
+
+    eapi = ebuild_prop('eapi')
+
+    slot = ebuild_prop('slot')
+
+    # Maybe homepage_val ?
+    homepage = ebuild_prop('homepage')
+
+    cpv = ebuild_prop('cpvstr')



             reply	other threads:[~2012-06-22  0:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22  0:02 Slava Bacherikov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-06-22  0:15 [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/libs/package_info/package_backends/ Slava Bacherikov
2012-08-07  0:10 Slava Bacherikov
2012-08-11 22:30 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=1340290590.ada7b1719ea4b37d3a9aba0eabad7e7e11d65761.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