From: Theo Chatzimichos Date: Wed, 2 Mar 2011 17:39:56 +0000 (-0800) Subject: grabdict: allow inline comments X-Git-Tag: v2.1.9.43~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bd20421195bfc73789494759c4a43617fdc66ce6;p=portage.git grabdict: allow inline comments --- diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index 55ffcfc8a..f31f33d49 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -314,6 +314,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: