From: Theo Chatzimichos Date: Wed, 2 Mar 2011 17:39:56 +0000 (-0800) Subject: grabdict: allow inline comments X-Git-Tag: v2.2.0_alpha27~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3ad5122a80f741119b48cb7f0f5107e64e2e3b11;p=portage.git grabdict: allow inline comments --- diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index d180f6b7d..0eaaeb209 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -349,6 +349,13 @@ def grabdict(myfilename, juststrings=0, empty=0, recursive=0, incremental=1): if x[0] == "#": continue myline=x.split() + mylinetemp = [] + for item in myline: + if not item.startswith('#'): + mylinetemp.append(item) + else: + break + myline = mylinetemp if len(myline) < 2 and empty == 0: continue if len(myline) < 1 and empty == 1: