The bug, which is cause of missing &#39;=&#39; , should of been fixed in one the more recent pushes. Ah, its fixed in my initial stab at context failure push.<br><br>Yea stuff seems to be sneaking in to my other branches. Will do your steps and figure out a clean branch.<br>
<br>Yup, it is extremely ugly....I wanted to get something working though after a couple hours of banging my head heh<br><br>Line ~813 does not really make sense to me anywhere, or 713 or 913 for that matter, so I can only assume you mean around...<br>
<br><a href="http://github.com/mlaite/pony-build/blob/env/client/pony_client.py#L776">http://github.com/mlaite/pony-build/blob/env/client/pony_client.py#L776</a><br><br>However.....With Virtualenv we have to catch the error before it even jumps into the &quot;<span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">commands</span><span class="p">:</span>&quot; All the Dependencies are done during the following call in do()<br>
<div style="background-color: transparent;" class="line" id="LC758"><span class="k">if</span> <span class="n">context</span><span class="p">:</span></div><div style="background-color: transparent;" class="line" id="LC759">
        <span class="n">context</span><span class="o">.</span><span class="n">initialize</span><span class="p">()<br><br>I originally tried doing the break in the for loop but it would never work how expected. Putting a failure in the for loop will only take care of build command errors (checkout,build,test)<br>
<br>This is still with global variable but want through out the general idea.....So what if we just put the &quot;for c in commands:&quot; inside an if....so....... if not error_state do the for loop.....So then that would take out all that redundancy and would skip to all the other steps if the test passes....<br>
</span></div><br><br><div class="gmail_quote">On Sat, Apr 17, 2010 at 2:23 PM, C. Titus Brown <span dir="ltr">&lt;<a href="mailto:ctb@msu.edu">ctb@msu.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Sat, Apr 10, 2010 at 05:29:38PM -0400, Max Laite wrote:<br>
&gt; Looking for some suggestions on how to go about doing this context failure<br>
&gt; stuff. Which we can assume should work for all context classes if we want it<br>
&gt; to and not just Virtualenv.<br>
<br>
</div>[ ... ]<br>
<br>
Hey Max,<br>
<br>
I merged my latest into your &#39;env&#39; branch, resolved a conflict, and pushed<br>
it to my &#39;max_env&#39; branch.  You should be able to pull from that branch<br>
into your &#39;env&#39; branch w/o any conflicts.<br>
<br>
A couple of comments --<br>
<br>
---<br>
<br>
The code in this branch contains a syntax error because of a bug in your<br>
log_level change:<br>
<br>
   <a href="http://github.com/mlaite/pony-build/commit/a2634e60c3c89de987bed9580552f01fa71be058" target="_blank">http://github.com/mlaite/pony-build/commit/a2634e60c3c89de987bed9580552f01fa71be058</a><br>
<br>
So not only are you not running your own code, you&#39;re not running the<br>
tests.  Tsk, tsk...<br>
<br>
Also, I think the log level is redundant with my --verbose and --debug<br>
changes.  What do you think?  That redundancy isn&#39;t necessarily bad;<br>
it might be nice to set a log level explicitly.  If you agree, could<br>
you call set_log_level, if-and-only-if -l is specified, just before<br>
&#39;parse_cmdline&#39; returns?<br>
<br>
Finally, please do this work in a branch separate from your context stuff.<br>
You can do this pretty easily --<br>
<br>
  git fetch ctb master:ctb   # fetch my latest into local branch &#39;ctb&#39;<br>
  git checkout ctb<br>
<br>
  git cherry-pick a2634e60c3   # grab your log_level patch.<br>
<br>
  ... continue work as usual ...<br>
<br>
This will let me merge it in independently of your Context work.<br>
<br>
--<br>
<br>
OK, on to the context stuff!<br>
<br>
globals are bad, for testing if nothing else -- imagine trying to test<br>
this code, you&#39;d have to reset the error_state variable every time.  Can<br>
you think of an object or scope to which to attach this state variable?<br>
<br>
What happens in your code if context is None?<br>
<br>
Also, error_state should be set if &#39;c.run(...)&#39; ~ line 813 raises an<br>
exception, and the for loop should abort at that point (although cleanup<br>
code should still run).<br>
<br>
In case c.run raises an exception, how should that exception be<br>
communicated to the server, do you think?<br>
<br>
That &#39;if error_state&#39; code is really ugly; you&#39;re duplicating the code at the<br>
end of the function.  Is there a way to refactor the code so that the &#39;exit&#39;<br>
cleanup code (file upload, etc.) is all at the end of the &#39;do&#39; function?<br>
<br>
--<br>
<br>
cheers,<br>
<font color="#888888">--titus<br>
</font></blockquote></div><br>