ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/ActiveDoc/PreProcessedFile.pm
(Generate patch)

Comparing COMP/SCRAM/src/ActiveDoc/PreProcessedFile.pm (file contents):
Revision 1.4 by williamc, Mon Nov 29 17:32:48 1999 UTC vs.
Revision 1.8 by williamc, Wed Mar 1 11:47:38 2000 UTC

# Line 45 | Line 45 | sub realline {
45          for(my $i=0; $i<=$#{$self->{includesdesc}}; $i++ ) {
46            $inc=$self->{includesdesc}[$i];
47            $startline=$inc->startline();
48 <          last if ( $line < $startline );
49 <          if ( $line > ($inc->lines()+$startline) ) {
50 <            $line=$line-$inc->lines()+1+($inc->endline()-$startline);
48 >          last if ( $line <= $startline );
49 >          if ( $line >= ($inc->lines()+$startline+2) ) {
50 >                                        # take out the 2 carriage returns added
51 >            $line=$line-($inc->lines()+$startline-$inc->endline())-2;
52                           # n lines in original map to m lines in expanded
53            }
54            else { # must be in the include file
55 <            ($line, $fileob)=$self->{includes}[$i]->
56 <                                        line($line-$startline+1);
55 >            ($line, $fileob)=$self->{includes}[$i]->realline($line-$startline);
56 >            last;
57            }
58          }
59          
# Line 69 | Line 70 | sub url {
70          my $self=shift;
71  
72          if ( @_ ) {
73 <          my $url=shift;
74 <          ($self->{url}, $file)=$self->{urlhandler}->get($url);
75 <        }
76 <        else {
77 <          $self->{url};
78 <        }
73 >        my $url=shift;
74 >          ($self->{url}, $file)=$self->{urlhandler}->get($url);
75 >        }
76 >        else {
77 >          $self->{url};
78 >        }
79   }
80  
81   sub ProcessedFile {
# Line 86 | Line 87 | sub file {
87          my $self=shift;
88          
89          my ($url, $file)=$self->{urlhandler}->get($self->url());
90 +        $self->verbose("Getting file ".$self->url()." = $file");
91          return $file;
92   }
93  
94 + sub ProcessFile {
95 +        my $self=shift;
96 +        return $self->file();
97 + }
98  
99   sub update {
100          my $self=shift;
# Line 120 | Line 126 | sub update {
126          }
127  
128          if ( $rv != 0 ) {
129 <         print " Need to Update ".$self->url()."\n";
129 >         $self->verbose(" Need to Update ".$self->url());
130            # ---- sort out the preprocessed file in the cache
131 <          my $newfile=$self->config()->cache()->
126 <                                filename($outfile);
131 >          my $newfile=$self->config()->cache()->filename($outfile);
132            $self->config()->cache()->store($outfile,$newfile);
133            
134            $self->process($self->config()->cache()->file($self->url()),$newfile);
# Line 132 | Line 137 | sub update {
137            $self->config->store($self,$self->url());
138          }
139          else {
140 <            print "No Need to Update ".$self->url()."\n";
140 >            $self->verbose("No Need to Update ".$self->url());
141          }
142          return $rv;
143   }
# Line 157 | Line 162 | sub process {
162          $self->parse("include", $self->{fileout}, "include_starttag");
163  
164          $self->{fileout}->close();
165 +        $self->verbose("$fileout Created");
166   }
167  
168   sub store {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines