<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On 2-nov-2006, at 6:32, Bill Bumgarner wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">[...]<SPAN class="Apple-converted-space">  </SPAN>There are three major features that I'd like to have right about now:</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">(1) be able to trigger pymate (scriptmate or whatever the new thing is called) to run a sort of "designated driver script" at the root level of a project directory. <SPAN class="Apple-converted-space">  </SPAN>Specifically:<SPAN class="Apple-converted-space">  </SPAN>I'm editing a unit test in my testsuite/ subdirectory and I want to hit a single command sequence to cause the run-tests.py script (found in the top level "project" directory -- top level directory resulting from a 'mate .' at the command line) to be executed.</FONT></DIV> </BLOCKQUOTE></DIV><BR><DIV> </DIV>At least your first wish-feature can easily be done.<BR><DIV>I just finished a (global) command, "attached" to my project, which does something remotely connected.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>It only runs if there is a special project variable saying so. It restarts Apache and after that's been successful, it loads (or refreshes) a "designated" test url.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>It uses a project variable ($MY_SITE_TEST ) to check whether it actually should do it's thing. And then, if there is no project variable $MY_SITE_TEST_URL given, it runs TextMateTestUrl.py, which just outputs a url to test. I like to get that url from this python script, for this allows me to add extra clauses (when to test what) and lets me add comments to these test urls.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>writing this script was fairly easy. The hardest part was to check on the stopping and starting of Apache.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I'm not sure if this helps any to the discussion, but I thought it was related, and I thought I share.</DIV><DIV>Below is the complete script, if this is usefull for anybody</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>best</DIV><DIV>dirk</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>if [[ "$MY_SITE_TEST" == 1 ]]; then</DIV><DIV>  if [[ "$MY_SITE_TEST_RESTART_APACHE" == 1 ]]; then</DIV><DIV>    #</DIV><DIV>    # For restarting apache we need to first stop it</DIV><DIV>    # and wait till all processes has been halted and</DIV><DIV>    # then restart it again.</DIV><DIV>    # We assume here that Apache has 4 (httpd) processes running</DIV><DIV>    # when fully functional and active</DIV><DIV>    #</DIV><DIV>    "${TM_BUNDLE_SUPPORT}/apachectlUsingKeychain.sh" stop</DIV><DIV>    for (( i = 0; i < 50 && $(echo $(ps -ax | grep [h]ttpd | wc -l)) > 0; i++ )); do</DIV><DIV>      sleep .2;</DIV><DIV>    done</DIV><DIV>    if [ $(ps -ax | grep [h]ttpd | wc -l) == 0 ]; then</DIV><DIV>      echo Apache has stopped</DIV><DIV>      "${TM_BUNDLE_SUPPORT}/apachectlUsingKeychain.sh" start</DIV><DIV>      for (( i = 0; i < 50 && $(echo $(ps -ax | grep [h]ttpd | wc -l)) < 4; i++ )); do</DIV><DIV>        sleep .2;</DIV><DIV>      done</DIV><DIV>      if [ $(ps -ax | grep [h]ttpd | wc -l) == 4 ]; then</DIV><DIV>        echo Apache has started again</DIV><DIV>      else</DIV><DIV>        echo "$(date +%Y-%m-%d\ %H:%M:%S): Apache not yet fully running. Run test aborted."</DIV><DIV>        exit</DIV><DIV>      fi</DIV><DIV>    else</DIV><DIV>      echo "$(date +%Y-%m-%d\ %H:%M:%S): Apache is still running. Relaunch aborted."</DIV><DIV>      exit</DIV><DIV>    fi</DIV><DIV>  fi</DIV><DIV>  if [[ $MY_SITE_TEST_URL ]]; then</DIV><DIV>    echo From the Project Preferences</DIV><DIV>    T_URL=$MY_SITE_TEST_URL</DIV><DIV>  else</DIV><DIV>    echo From the TextMateTestUrl script</DIV><DIV>    TPY=${TM_PYTHON:-pythonw}</DIV><DIV>    T_URL=$(echo $("$TPY" "$TM_PROJECT_DIRECTORY/TextMateTestUrl.py"))</DIV><DIV>  fi</DIV><DIV>  osascript -e "tell app \"Safari\" to open location \"$T_URL\""</DIV><DIV>fi</DIV></BODY></HTML>