<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 16, 2015 at 1:44 PM, Richard Purdie <span dir="ltr">&lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":4nx" class="a3s" style="overflow:hidden">-                for f in fl.split():<br>
+                fl = fl.strip()<br>
+                while fl:<br>
+                    # A .split() would be simpler but means spaces or colons in filenames would break<br>
+                    a = fl.find(&quot;:True&quot;)<br>
+                    b = fl.find(&quot;:False&quot;)<br>
+                    if ((a &lt; 0) and b) or ((b &gt; 0) and (b &lt; a)):<br>
+                       f = fl[:b+6]<br>
+                       fl = fl[b+7:]<br>
+                    elif ((b &lt; 0) and a) or ((a &gt; 0) and (a &lt; b)):<br>
+                       f = fl[:a+5]<br>
+                       fl = fl[a+6:]<br>
+                    else:<br>
+                       break<br>
+                    fl = fl.strip()</div></blockquote></div><br>Hmm, another option would be to re.split(&#39;(:(True|False))&#39;, fl). When the pattern you&#39;re splitting on is grouped, it&#39;s kept in the results, so you&#39;d get a list of file, :True/False, next file, :True/False, ..</div><div class="gmail_extra">-- <br><div class="gmail_signature">Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div>
</div></div>