public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/dep/
Date: Sun, 10 Jun 2012 23:05:33 +0000 (UTC)	[thread overview]
Message-ID: <1339369521.07fbd0a29455f2e74c66b37f30c62a7ddb0c5571.zmedico@gentoo> (raw)

commit:     07fbd0a29455f2e74c66b37f30c62a7ddb0c5571
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 10 23:05:21 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jun 10 23:05:21 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=07fbd0a2

_get_eapi_attrs: move to eapi module

---
 pym/portage/dep/__init__.py |   33 +--------------------------------
 pym/portage/eapi.py         |   30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 32 deletions(-)

diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index d985486..6c2a3ad 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -27,7 +27,6 @@ __all__ = [
 # "a? ( b? ( z ) ) -- Valid
 #
 
-import collections
 import re, sys
 import warnings
 from itertools import chain
@@ -38,9 +37,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
 )
 
 from portage import _unicode_decode
-from portage.eapi import eapi_has_slot_deps, eapi_has_src_uri_arrows, \
-	eapi_has_use_deps, eapi_has_strong_blocks, eapi_has_use_dep_defaults, \
-	eapi_has_repo_deps, eapi_allows_dots_in_PN, eapi_allows_dots_in_use_flags
+from portage.eapi import eapi_has_src_uri_arrows, _get_eapi_attrs
 from portage.exception import InvalidAtom, InvalidData, InvalidDependString
 from portage.localization import _
 from portage.versions import catpkgsplit, catsplit, \
@@ -72,34 +69,6 @@ _repo = r'(?:' + _repo_separator + '(' + _repo_name + ')' + ')?'
 
 _extended_cat = r'[\w+*][\w+.*-]*'
 
-_eapi_attrs = collections.namedtuple('_eapi_attrs',
-	'dots_in_PN dots_in_use_flags repo_deps slot_deps '
-	'strong_blocks use_deps use_dep_defaults')
-
-_eapi_attrs_cache = {}
-
-def _get_eapi_attrs(eapi):
-	"""
-	When eapi is None then validation is not as strict, since we want the
-	same to work for multiple EAPIs that may have slightly different rules.
-	"""
-	eapi_attrs = _eapi_attrs_cache.get(eapi)
-	if eapi_attrs is not None:
-		return eapi_attrs
-
-	eapi_attrs = _eapi_attrs(
-		dots_in_PN = (eapi is None or eapi_allows_dots_in_PN(eapi)),
-		dots_in_use_flags = (eapi is None or eapi_allows_dots_in_use_flags(eapi)),
-		repo_deps = (eapi is None or eapi_has_repo_deps(eapi)),
-		slot_deps = (eapi is None or eapi_has_slot_deps(eapi)),
-		strong_blocks = (eapi is None or eapi_has_strong_blocks(eapi)),
-		use_deps = (eapi is None or eapi_has_use_deps(eapi)),
-		use_dep_defaults = (eapi is None or eapi_has_use_dep_defaults(eapi))
-	)
-
-	_eapi_attrs_cache[eapi] = eapi_attrs
-	return eapi_attrs
-
 _atom_re_cache = {}
 
 def _get_atom_re(eapi_attrs):

diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py
index 79cf891..4dd02db 100644
--- a/pym/portage/eapi.py
+++ b/pym/portage/eapi.py
@@ -1,6 +1,8 @@
 # Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import collections
+
 def eapi_has_iuse_defaults(eapi):
 	return eapi != "0"
 
@@ -60,3 +62,31 @@ def eapi_allows_dots_in_PN(eapi):
 
 def eapi_allows_dots_in_use_flags(eapi):
 	return eapi in ("4-python",)
+
+_eapi_attrs = collections.namedtuple('_eapi_attrs',
+	'dots_in_PN dots_in_use_flags repo_deps slot_deps '
+	'strong_blocks use_deps use_dep_defaults')
+
+_eapi_attrs_cache = {}
+
+def _get_eapi_attrs(eapi):
+	"""
+	When eapi is None then validation is not as strict, since we want the
+	same to work for multiple EAPIs that may have slightly different rules.
+	"""
+	eapi_attrs = _eapi_attrs_cache.get(eapi)
+	if eapi_attrs is not None:
+		return eapi_attrs
+
+	eapi_attrs = _eapi_attrs(
+		dots_in_PN = (eapi is None or eapi_allows_dots_in_PN(eapi)),
+		dots_in_use_flags = (eapi is None or eapi_allows_dots_in_use_flags(eapi)),
+		repo_deps = (eapi is None or eapi_has_repo_deps(eapi)),
+		slot_deps = (eapi is None or eapi_has_slot_deps(eapi)),
+		strong_blocks = (eapi is None or eapi_has_strong_blocks(eapi)),
+		use_deps = (eapi is None or eapi_has_use_deps(eapi)),
+		use_dep_defaults = (eapi is None or eapi_has_use_dep_defaults(eapi))
+	)
+
+	_eapi_attrs_cache[eapi] = eapi_attrs
+	return eapi_attrs



             reply	other threads:[~2012-06-10 23:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-10 23:05 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-09-22 21:52 [gentoo-commits] proj/portage:master commit in: pym/portage/, pym/portage/dep/ Zac Medico
2012-06-10 23:16 Zac Medico
2012-05-12  4:08 Arfrever Frehtes Taifersar Arahesis
2011-06-08 16:10 Arfrever Frehtes Taifersar Arahesis

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=1339369521.07fbd0a29455f2e74c66b37f30c62a7ddb0c5571.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --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