grabdict: allow inline comments
authorTheo Chatzimichos <tampakrap@gentoo.org>
Wed, 2 Mar 2011 17:39:56 +0000 (09:39 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 14 Mar 2011 16:03:12 +0000 (09:03 -0700)
pym/portage/util/__init__.py

index 55ffcfc8a1a53c2ddf2fbae6148fe0ba5e521695..f31f33d495983a38f425234d08bb2da3f454d593 100644 (file)
@@ -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: