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 1PzAZy-0008Ok-Sq for garchives@archives.gentoo.org; Mon, 14 Mar 2011 16:25:11 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0D59A1C008; Mon, 14 Mar 2011 16:24:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D599A1C040 for ; Mon, 14 Mar 2011 16:24:43 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5473C1B424D for ; Mon, 14 Mar 2011 16:24:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 9054B80073 for ; Mon, 14 Mar 2011 16:24:42 +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: Subject: [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/__init__.py X-VCS-Directories: pym/portage/util/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: b0115fb837bf197c64bb686ba6cf94aa52465379 Date: Mon, 14 Mar 2011 16:24:42 +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: 1dc002c97977f6f119aaa514f5361f1f commit: b0115fb837bf197c64bb686ba6cf94aa52465379 Author: Zac Medico gentoo org> AuthorDate: Wed Mar 2 17:59:11 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Mar 14 16:03:20 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Db0115fb8 grablines: allow inline comments --- pym/portage/util/__init__.py | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index f31f33d..8b27be5 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -125,8 +125,18 @@ def grabfile(myfilename, compat_level=3D0, recursive= =3D0, remember_source_file=3DFalse for x, source_file in mylines: #the split/join thing removes leading and trailing whitespace, and con= verts any whitespace in the line #into single spaces. - myline =3D _unicode_decode(' ').join(x.split()) - if not len(myline): + myline =3D x.split() + if x and x[0] !=3D "#": + mylinetemp =3D [] + for item in myline: + if item[:1] !=3D "#": + mylinetemp.append(item) + else: + break + myline =3D mylinetemp + + myline =3D " ".join(myline) + if not myline: continue if myline[0]=3D=3D"#": # Check if we have a compat-level string. BC-integration data. @@ -316,7 +326,7 @@ def grabdict(myfilename, juststrings=3D0, empty=3D0, = recursive=3D0, incremental=3D1): myline=3Dx.split() mylinetemp =3D [] for item in myline: - if not item.startswith('#'): + if item[:1] !=3D "#": mylinetemp.append(item) else: break