From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Lb00n-00080J-C9 for garchives@archives.gentoo.org; Sat, 21 Feb 2009 22:07:54 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C867AE042D; Sat, 21 Feb 2009 22:07:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9BE32E042D for ; Sat, 21 Feb 2009 22:07:52 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id C6FD4B6897 for ; Sat, 21 Feb 2009 22:07:51 +0000 (UTC) Received: from zmedico by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1Lb00l-0002Lh-MC for gentoo-commits@lists.gentoo.org; Sat, 21 Feb 2009 22:07:51 +0000 To: gentoo-commits@lists.gentoo.org From: "Zac Medico (zmedico)" Subject: [gentoo-commits] portage r12674 - in main/trunk/pym/portage: . cache X-VCS-Repository: portage X-VCS-Revision: 12674 X-VCS-Files: main/trunk/pym/portage/__init__.py main/trunk/pym/portage/cache/mappings.py main/trunk/pym/portage/util.py X-VCS-Directories: . cache X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico Content-Type: text/plain; charset=UTF-8 Message-Id: Sender: Zac Medico Date: Sat, 21 Feb 2009 22:07:51 +0000 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: a8b33077-994f-4a0c-b6bf-1d1384fdcf66 X-Archives-Hash: 0c21b201ba6bba08937405ff74887f7b Author: zmedico Date: 2009-02-21 22:07:51 +0000 (Sat, 21 Feb 2009) New Revision: 12674 Modified: main/trunk/pym/portage/__init__.py main/trunk/pym/portage/cache/mappings.py main/trunk/pym/portage/util.py Log: Make the UserDict and LazyItemsDict constructors use an optional position= al argument instead of a keyword argument. Modified: main/trunk/pym/portage/__init__.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- main/trunk/pym/portage/__init__.py 2009-02-21 21:51:13 UTC (rev 12673= ) +++ main/trunk/pym/portage/__init__.py 2009-02-21 22:07:51 UTC (rev 12674= ) @@ -7693,7 +7693,7 @@ myroots.append((settings["ROOT"], settings)) =20 for myroot, mysettings in myroots: - trees[myroot] =3D portage.util.LazyItemsDict(trees.get(myroot, None)) + trees[myroot] =3D portage.util.LazyItemsDict(trees.get(myroot, {})) trees[myroot].addLazySingleton("virtuals", mysettings.getvirtuals, myr= oot) trees[myroot].addLazySingleton( "vartree", vartree, myroot, categories=3Dmysettings.categories, Modified: main/trunk/pym/portage/cache/mappings.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- main/trunk/pym/portage/cache/mappings.py 2009-02-21 21:51:13 UTC (rev= 12673) +++ main/trunk/pym/portage/cache/mappings.py 2009-02-21 22:07:51 UTC (rev= 12674) @@ -139,10 +139,16 @@ http://bugs.python.org/issue2876 """ =20 - def __init__(self, dict=3DNone, **kwargs): - self.data =3D {} - if dict is not None: - self.update(dict) + def __init__(self, *args, **kwargs): + + if len(args) > 1: + raise TypeError( + "expected at most 1 positional argument, got " + \ + repr(len(args))) + + if args: + self.update(args[0]) + if kwargs: self.update(kwargs) =20 Modified: main/trunk/pym/portage/util.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- main/trunk/pym/portage/util.py 2009-02-21 21:51:13 UTC (rev 12673) +++ main/trunk/pym/portage/util.py 2009-02-21 22:07:51 UTC (rev 12674) @@ -1201,11 +1201,22 @@ =20 __slots__ =3D ('lazy_items',) =20 - def __init__(self, initial_items=3DNone): + def __init__(self, *args, **kwargs): + + if len(args) > 1: + raise TypeError( + "expected at most 1 positional argument, got " + \ + repr(len(args))) + dict.__init__(self) self.lazy_items =3D {} - if initial_items is not None: - self.update(initial_items) + + if args: + self.update(args[0]) + + if kwargs: + self.update(kwargs) + def addLazyItem(self, item_key, value_callable, *pargs, **kwargs): """Add a lazy item for the given key. When the item is requested, value_callable will be called with *pargs and **kwargs arguments."""