changeset 17:6da973a6b93d

better reload caps.
author Robert McIntyre <rlm@mit.edu>
date Wed, 02 Nov 2011 05:14:21 -0700
parents f433fae15c50
children 993b8d7d9bec
files auto-weave.pl
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/auto-weave.pl	Wed Nov 02 05:01:57 2011 -0700
     1.2 +++ b/auto-weave.pl	Wed Nov 02 05:14:21 2011 -0700
     1.3 @@ -15,7 +15,7 @@
     1.4  
     1.5  for $file(@org_files){print "$file\n";}
     1.6  $ignore_next = 0;
     1.7 -
     1.8 +$last_page = "";
     1.9  
    1.10  foreach(@org_files){
    1.11  # add watchers
    1.12 @@ -38,7 +38,15 @@
    1.13      $path = `readlink -f $name`;
    1.14      $path =~ s|/home/r/proj|http://aurellem.localhost|;
    1.15      $path =~ s|org|html|g;
    1.16 -    $mech->get($path);
    1.17 +    if ($last_page eq $path){
    1.18 +	print "reloading current page : $path\n";
    1.19 +	$mech->reload();
    1.20 +    }
    1.21 +    else {
    1.22 +	print "moving to new page : $path\n";
    1.23 +	$last_page = $path;
    1.24 +	$mech->get($path);
    1.25 +    }
    1.26  });
    1.27  }
    1.28