From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RK0MS-0004UD-5d for garchives@archives.gentoo.org; Sat, 29 Oct 2011 04:17:36 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F123921C021; Sat, 29 Oct 2011 04:17:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B058C21C021 for ; Sat, 29 Oct 2011 04:17:25 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E40061B401A for ; Sat, 29 Oct 2011 04:17:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 1EA7680038 for ; Sat, 29 Oct 2011 04:17:19 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <3cfb2bc711d820fcef376aee170de560d8195819.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/dbapi/bintree.py pym/portage/dbapi/porttree.py pym/portage/dbapi/vartree.py X-VCS-Directories: pym/portage/dbapi/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 3cfb2bc711d820fcef376aee170de560d8195819 Date: Sat, 29 Oct 2011 04:17:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 21e99fe9a3df45a68eb8a4422a90781f commit: 3cfb2bc711d820fcef376aee170de560d8195819 Author: Zac Medico gentoo org> AuthorDate: Sat Oct 29 04:17:11 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Oct 29 04:17:11 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D3cfb2bc7 Deprecate unused 'virtual' constructor parameters --- pym/portage/dbapi/bintree.py | 9 ++++++++- pym/portage/dbapi/porttree.py | 18 ++++++++++++++++-- pym/portage/dbapi/vartree.py | 8 +++++++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 0fb8be9..4c24929 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -243,7 +243,8 @@ def _pkgindex_cpv_map_latest_build(pkgindex): =20 class binarytree(object): "this tree scans for a list of all packages available in PKGDIR" - def __init__(self, _unused=3DNone, pkgdir=3DNone, virtual=3DNone, setti= ngs=3DNone): + def __init__(self, _unused=3DNone, pkgdir=3DNone, + virtual=3DDeprecationWarning, settings=3DNone): =20 if pkgdir is None: raise TypeError("pkgdir parameter is required") @@ -258,6 +259,12 @@ class binarytree(object): "settings['ROOT'] instead.", DeprecationWarning, stacklevel=3D2) =20 + if virtual is not DeprecationWarning: + warnings.warn("The 'virtual' parameter of the " + "portage.dbapi.bintree.binarytree" + " constructor is unused", + DeprecationWarning, stacklevel=3D2) + if True: self.pkgdir =3D normalize_path(pkgdir) self.dbapi =3D bindbapi(self, settings=3Dsettings) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.p= y index fc7feb3..5c45d97 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -1064,7 +1064,7 @@ def close_portdbapi_caches(): portage.process.atexit_register(portage.portageexit) =20 class portagetree(object): - def __init__(self, root=3DNone, virtual=3DNone, settings=3DNone): + def __init__(self, root=3DNone, virtual=3DDeprecationWarning, settings=3D= None): """ Constructor for a PortageTree =09 @@ -1087,8 +1087,14 @@ class portagetree(object): "settings['ROOT'] instead.", DeprecationWarning, stacklevel=3D2) =20 + if virtual is not DeprecationWarning: + warnings.warn("The 'virtual' parameter of the " + "portage.dbapi.porttree.portagetree" + " constructor is unused", + DeprecationWarning, stacklevel=3D2) + self.portroot =3D settings["PORTDIR"] - self.virtual =3D virtual + self.__virtual =3D virtual self.dbapi =3D portdbapi(mysettings=3Dsettings) =20 @property @@ -1100,6 +1106,14 @@ class portagetree(object): DeprecationWarning, stacklevel=3D3) return self.settings['ROOT'] =20 + @property + def virtual(self): + warnings.warn("The 'virtual' attribute of " + \ + "portage.dbapi.porttree.portagetree" + \ + " is deprecated.", + DeprecationWarning, stacklevel=3D3) + return self.__virtual + def dep_bestmatch(self,mydep): "compatibility method" mymatch =3D self.dbapi.xmatch("bestmatch-visible",mydep) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index e719062..ee0db6f 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1163,7 +1163,7 @@ class vardbapi(dbapi): =20 class vartree(object): "this tree will scan a var/db/pkg database located at root (passed to i= nit)" - def __init__(self, root=3DNone, virtual=3DNone, categories=3DNone, + def __init__(self, root=3DNone, virtual=3DDeprecationWarning, categorie= s=3DNone, settings=3DNone): =20 if settings is None: @@ -1176,6 +1176,12 @@ class vartree(object): "settings['ROOT'] instead.", DeprecationWarning, stacklevel=3D2) =20 + if virtual is not DeprecationWarning: + warnings.warn("The 'virtual' parameter of the " + "portage.dbapi.vartree.vartree" + " constructor is unused", + DeprecationWarning, stacklevel=3D2) + self.settings =3D settings self.dbapi =3D vardbapi(settings=3Dsettings, vartree=3Dself) self.populated =3D 1