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>
Wed, 2 Mar 2011 17:39:56 +0000 (09:39 -0800)
pym/portage/util/__init__.py

index d180f6b7dae37185dc5f35c5d19bdad32babf2d0..0eaaeb2097712c892f830407a0322afebf0d7cef 100644 (file)
@@ -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: