/[PLies]/burst.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /burst.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by dpavlin, Tue May 8 23:03:03 2001 UTC revision 1.16 by dpavlin, Fri May 11 14:17:27 2001 UTC
# Line 143  my @pack_additional;   # additional files Line 143  my @pack_additional;   # additional files
143                  # of the slidemaker tool                  # of the slidemaker tool
144                  #when the parameters were in Makefile or make.bat                  #when the parameters were in Makefile or make.bat
145    
146  # read parameters from infos.txt and put them in @PARAM  my @file;
147  if (open(INFOS, $infos)) {  
148          print STDERR "--- Reading parameters file $infos ---\n";  ##############################################################################
149          local(@file);  sub parse_infos {
150          @file = <INFOS>;          my @file=@_;
 #       @PARAM = ();    # don't reset param, use @ARGV  
151          do {          do {
152                  if ($file[0] && $file[0] =~ /^[^#\n\r]/) {                  if ($file[0] && $file[0] =~ /^[^#\n\r]/) {
153                          $file[0] =~ s/\n//;    # remove UNIX \n                          $file[0] =~ s/\n//;    # remove UNIX \n
154                          $file[0] =~ s/\r//;    # remove WINDOWS \r                              $file[0] =~ s/\r//;    # remove WINDOWS \r    
155                          $file[0] =~ s/ *= */=/;                          my ($var,$value) = split(/ *= */,$file[0],2);
156                          push @PARAM,$file[0];                          $value=~s/'/\\'/g;
157                            $cmd="\$$var = \'$value\';";
158                            if (defined($value)) {
159                                    eval($cmd) || warn "problem with eval of: $cmd";
160                            } else {
161                                    die "no value defined for $var";
162                            }
163                          print STDERR "$file[0]\n";                          print STDERR "$file[0]\n";
164                  }                  }
165          } while (shift(@file));          } while (shift(@file));
166  }  }
167  ## @PARAM is now a table with the user preferences for his presentation  ##############################################################################
168    
169  ## process arguments  # read parameters from infos.txt and put them in @PARAM
170  ## each preset variable is now re-attributed using the user preferences  if (open(INFOS, $infos)) {
171  foreach (@PARAM) {          print STDERR "--- Reading parameters file $infos ---\n";
172          my ($var,$value) = split(/ *= */,$_,2);          @file = <INFOS>;
173          $value=~s/'/\\'/g;          parse_infos(@file);
174          $cmd="\$$var = \'$value\';";  }
175          if ($value) {  
176                  eval($cmd) || die "problem with eval of: $cmd";  # try to read local infos.txt for template
177          } else {  if (-f "$template/$infos" && open(INFOS,"$template/$infos")) {
178                  die "no value defined for $var";          print STDERR "--- Reading template parameters file $template/$infos ---\n";
179          }          @file = <INFOS>;
180            parse_infos(@file);
181            close(INFOS);
182  }  }
183    
184    ## @PARAM is now a table with the user preferences for his presentation
185    
186  ## use charset  ## use charset
187    
188  if ($charset) {  if ($charset) {
# Line 385  sub openOverview Line 394  sub openOverview
394    
395                  date => $date,                  date => $date,
396    
397                  toc => $loc_toc,                  toc_title => $loc_toc,
398                    template => $template,
399          );          );
400    
401  }  }
# Line 578  sub createSlide Line 588  sub createSlide
588                  toc_link => $toc_link,                  toc_link => $toc_link,
589                  next_link => $next_link,                  next_link => $next_link,
590                  prev_title => $prev_title,                  prev_title => $prev_title,
591                    toc_title => $loc_toc,
592                  next_title => $next_title,                  next_title => $next_title,
593    
594                  author => $author,                  author => $author,
# Line 589  sub createSlide Line 600  sub createSlide
600    
601                  slide_html => $slide_html,                  slide_html => $slide_html,
602    
603                    template => $template,
604          );          );
605    
606          my $page;          my $page;
# Line 684  sub make_progress_bar { Line 696  sub make_progress_bar {
696          my $pcnt_done=int($nr*100/$total);          my $pcnt_done=int($nr*100/$total);
697          my $pcnt_left=100-$pcnt_done;          my $pcnt_left=100-$pcnt_done;
698    
699          if ($progress_bar) {          if ($progress_bar && uc($progress_bar) ne "NO") {
700                  my $l=$r="&nbsp;";                  my $l=$r="&nbsp;";
701                  my $t="$nr of $total";                  my $t="$nr of $total";
702                  if ($pcnt_done > 50) {                  if ($pcnt_done > 50) {
# Line 692  sub make_progress_bar { Line 704  sub make_progress_bar {
704                  } else {                  } else {
705                          $r=$t;                          $r=$t;
706                  }                  }
707                  $html='<table border="0" width="50%" cellpadding="0" cellspacing="0" align="right"><tr><td width="'.$pcnt_done.'%" class="pcnt-done">'.$l.'</td><td width="'.$pcnt_left.'%" class="pcnt-left">'.$r.'</td></tr></table>';                  $html='<table border="0" width="50%" cellpadding="0" cellspacing="0" align="right"><tr>';
708                    if ($pcnt_done != 0) {
709                            $html.='<td width="'.$pcnt_done.'%" class="pcnt-done">'.$l.'</td>';
710                    }
711                    if ($pcnt_left != 0) {
712                            $html.='<td width="'.$pcnt_left.'%" class="pcnt-left">'.$r.'</td>';
713                    }
714                    $html.='</tr></table>';
715          } else {          } else {
716                  $html="$loc_slide $nr $loc_of $total";                  $html="$loc_slide $nr $loc_of $total";
717          }          }

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.26