[Bio] / FigKernelPackages / ServerThing.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/ServerThing.pm

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

revision 1.30, Fri Dec 11 21:21:04 2009 UTC revision 1.31, Mon Dec 14 20:59:35 2009 UTC
# Line 311  Line 311 
311      if ($cgi->param('pod')) {      if ($cgi->param('pod')) {
312          # Here we have a documentation request. In this case, we produce POD HTML.          # Here we have a documentation request. In this case, we produce POD HTML.
313          ProducePod($cgi->param('pod'));          ProducePod($cgi->param('pod'));
314        } elsif ($cgi->param('code')) {
315            LineNumberize($cgi->param('code'));
316      } elsif ($cgi->param('file')) {      } elsif ($cgi->param('file')) {
317          # Here we have a file request. Process according to the type.          # Here we have a file request. Process according to the type.
318          my $type = $cgi->param('file');          my $type = $cgi->param('file');
# Line 462  Line 464 
464  }  }
465    
466    
467    =head3 LineNumberize
468    
469        ServerThing::LineNumberize($module);
470    
471    Output the module line by line with line numbers
472    
473    =over 4
474    
475    =item module
476    
477    Name of the module to line numberized
478    
479    =back
480    
481    =cut
482    
483    sub LineNumberize {
484        # Get the parameters.
485        my ($module) = @_;
486        my $fks_path = "$FIG_Config::fig_disk/dist/releases/current/FigKernelScripts/$module";
487        # Start the output page.
488        print CGI::header();
489        print CGI::start_html(-title => 'Documentation Page',
490                              -style => { src => "http://servers.nmpdr.org/sapling/Html/css/ERDB.css" });
491        # Protect from errors.
492        eval {
493            if (-e  $fks_path) {
494                    print "<pre>\n";
495                    my $i = 1;
496                    foreach my $line (`cat $fks_path`) {
497                            print "$i.\t$line";
498                            $i++;
499                    }
500                    print "</pre>\n";
501            } else {
502                    print "File $fks_path not found";
503            }
504    
505        };
506        # Process any error.
507        if ($@) {
508            print CGI::blockquote({ class => 'error' }, $@);
509        }
510        # Close off the page.
511        print CGI::end_html();
512    
513    }
514    
515  =head3 ProducePod  =head3 ProducePod
516    
517      ServerThing::ProducePod($module);      ServerThing::ProducePod($module);

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3