Changeset 7904


Ignore:
Timestamp:
2004-08-06T16:38:44+12:00 (20 years ago)
Author:
chi
Message:

Minor changes to layout of code.

Location:
trunk/gsdl/perllib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/arcinfo.pm

    r3416 r7904  
    4848
    4949    $self->{'info'} = {};
    50 
     50 
    5151    if (-e $filename) {
    5252    open (INFILE, $filename) ||
     
    6161        }
    6262    }
    63 
    6463    close (INFILE);
    6564    }
     
    7473    open (OUTFILE, ">$filename") ||
    7574    die "arcinfo::save_info couldn't write $filename\n";
    76 
     75 
    7776    foreach $info (@{$self->get_OID_list()}) {
    7877    if (defined $info) {
     
    8079    }
    8180    }
    82    
    8381    close (OUTFILE);
    8482}
  • trunk/gsdl/perllib/mgbuilder.pm

    r7150 r7904  
    158158    }
    159159    $self->{'pluginfo'} = &plugin::load_plugins ($plugins, $verbosity, $outhandle, $failhandle, \@global_opts);
     160   
    160161    if (scalar(@{$self->{'pluginfo'}}) == 0) {
    161162    print $outhandle "No plugins were loaded.\n";
     
    191192    $buildproctype = "mgbuildproc";
    192193    }
     194 
    193195    require "$buildprocdir/$buildproctype.pm";
    194196
     
    264266    $self->{'buildproc'}->set_index ($textindex);
    265267    $self->{'buildproc'}->set_indexing_text (0);
     268
     269
    266270    if ($self->{'no_text'}) {
    267271    $self->{'buildproc'}->set_store_text(0);
     
    270274    }
    271275    $self->{'buildproc'}->reset();
     276
    272277    &plugin::begin($self->{'pluginfo'}, $self->{'source_dir'},
    273278           $self->{'buildproc'}, $self->{'maxdocs'});
     
    275280           "", {}, $self->{'buildproc'}, $self->{'maxdocs'});
    276281    &plugin::end($self->{'pluginfo'});
     282   
    277283
    278284    close ($handle) unless $self->{'debug'};
     
    311317    &plugin::read ($self->{'pluginfo'}, $self->{'source_dir'},
    312318           "", {}, $self->{'buildproc'}, $self->{'maxdocs'});
     319
    313320    close ($handle) unless $self->{'debug'};
    314321
     
    635642           "", {}, $self->{'buildproc'}, $self->{'maxdocs'});
    636643
     644   
    637645    $self->print_stats ();
    638646
     
    925933    my $num_bytes = $self->{'buildproc'}->get_num_bytes();
    926934    my $num_processed_bytes = $self->{'buildproc'}->get_num_processed_bytes();
    927 
     935   
    928936    if ($indexing_text) {
    929937    print $outhandle "Stats (Creating index $index)\n";
     
    933941    print $outhandle "Total bytes in collection: $num_bytes\n";
    934942    print $outhandle "Total bytes in $index: $num_processed_bytes\n";
    935 
     943   
    936944    if ($num_processed_bytes < 50 && ($indexing_text || !$self->{'no_text'})) {
    937945    print $outhandle "***************\n";
     
    948956
    9499571;
     958
     959
     960
  • trunk/gsdl/perllib/mgppbuilder.pm

    r7150 r7904  
    305305    my $basefilename = "text/$self->{'collection'}";
    306306    my $fulltextprefix = &util::filename_cat ($self->{'build_dir'}, $basefilename);
    307 
     307   
    308308   my $osextra = "";
    309309    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
  • trunk/gsdl/perllib/plugin.pm

    r7829 r7904  
    8383    }
    8484    $options =~ s/\$/\\\$/g;
    85    
     85
    8686    eval ("\$plugobj = new \$pluginname($options)");
    8787    die "$@" if $@;
     
    100100sub begin {
    101101    my ($pluginfo, $base_dir, $processor, $maxdocs) = @_;
     102   
    102103
    103104    map { $_->begin($pluginfo, $base_dir, $processor, $maxdocs); } @$pluginfo;
     
    106107sub read {
    107108    my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $gli, $aux) = @_;
     109 
    108110
    109111    $maxdocs = -1 unless defined $maxdocs && $maxdocs =~ /\d/;
    110112    $gli = 0 unless defined $gli;
    111113
     114 
    112115    my $rv = 0;
    113116    my $glifile = $file;
     117   
    114118    $glifile =~ s/^[\/\\]+//; # file sometimes starts with a / so get rid of it
    115119    # Announce to GLI that we are handling a file
    116120    print STDERR "<File n='$glifile'>\n" if $gli;
    117121
     122 
    118123    # the .kill file is a handy (if not very elegant) way of aborting
    119124    # an import.pl or buildcol.pl process
     
    134139    $rv = $plugobj->read($pluginfo, $base_dir, $file,
    135140                 $metadata, $processor, $maxdocs, $gli, $aux);
    136     if (defined $rv) {
     141        if (defined $rv) {
    137142        if ($rv == -1) {
    138         # an error has occurred
     143            # an error has occurred
    139144        $had_error = 1;
    140145        print STDERR "<ProcessingError n='$glifile'>\n" if $gli;
    141146        } else {
    142         return $rv;
     147            return $rv;
    143148        }
    144149    } # else undefined - was not recognised by the plugin
    145150    }
    146    
     151
    147152    if ($had_error) {
    148153    # was recognised but couldn't be processed
     
    152157    # tell the GLI that it was not processed
    153158    print STDERR "<NonProcessedFile n='$glifile'>\n" if $gli;
    154    
     159     
    155160    $file =~ s/.*?([^\\\/]+)$/$1/;
    156161    gsprintf($failhandle, "$file: {plugin.no_plugin_could_process_this_file}\n");
Note: See TracChangeset for help on using the changeset viewer.