[cig-commits] r15824 - doc/geodynamics.org/benchmarks/trunk

luis at geodynamics.org luis at geodynamics.org
Sun Oct 18 00:18:04 PDT 2009


Author: luis
Date: 2009-10-18 00:18:03 -0700 (Sun, 18 Oct 2009)
New Revision: 15824

Modified:
   doc/geodynamics.org/benchmarks/trunk/reload-firefox.scpt
   doc/geodynamics.org/benchmarks/trunk/watcher.c
Log:
Updated reload-firefox.scpt

Modified: doc/geodynamics.org/benchmarks/trunk/reload-firefox.scpt
===================================================================
--- doc/geodynamics.org/benchmarks/trunk/reload-firefox.scpt	2009-10-18 07:17:56 UTC (rev 15823)
+++ doc/geodynamics.org/benchmarks/trunk/reload-firefox.scpt	2009-10-18 07:18:03 UTC (rev 15824)
@@ -1,10 +1,18 @@
 -- http://forums.macosxhints.com/showthread.php?t=36025
+-- http://developer.apple.com/mac/library/documentation/AppleScript/Conceptual/AppleScriptLangGuide/introduction/ASLR_intro.html
 
-tell application "Firefox"
-    activate
-    tell application "System Events"
-        tell process "Firefox"
-            keystroke "r" using {command down}
+on run argv
+    if argv is equal to {} then
+        tell application "Firefox"
+            activate
+            tell application "System Events"
+                tell process "Firefox" to keystroke "r" using {command down}
+            end tell
         end tell
-    end tell
-end tell
+    else
+        set theUrl to (item 1 of argv)
+        tell application "Firefox" to activate
+        do shell script "open -a Firefox " & theUrl
+    end if
+end run
+

Modified: doc/geodynamics.org/benchmarks/trunk/watcher.c
===================================================================
--- doc/geodynamics.org/benchmarks/trunk/watcher.c	2009-10-18 07:17:56 UTC (rev 15823)
+++ doc/geodynamics.org/benchmarks/trunk/watcher.c	2009-10-18 07:18:03 UTC (rev 15824)
@@ -286,6 +286,9 @@
     struct timespec timeout;
     unsigned int vnode_events;
 
+    /* whether to reload browser when an event happens */
+    int reloading = 1;
+
     /* get list of files to monitor */
     f = readfiles();
     if (f == NULL)
@@ -388,6 +391,13 @@
                 (fflags & NOTE_DELETE))
             {
                 system("./generate.py");
+
+                if (reloading)
+                {
+                    char cmd[1024];
+                    snprintf(cmd, 1024, "./reload-firefox.sh %s", n->path);
+                    system(cmd);
+                }
             }
         }
 



More information about the CIG-COMMITS mailing list