Changeset 8716 for trunk/gsdl/perllib/plugins/BasPlug.pm
- Timestamp:
- 2004-12-01T16:14:11+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/BasPlug.pm
r8678 r8716 143 143 sub get_arguments 144 144 { 145 local$self = shift(@_);146 local$optionlistref = $self->{'option_list'};147 local@optionlist = @$optionlistref;148 local$pluginoptions = pop(@$optionlistref);149 local$pluginarguments = $pluginoptions->{'args'};145 my $self = shift(@_); 146 my $optionlistref = $self->{'option_list'}; 147 my @optionlist = @$optionlistref; 148 my $pluginoptions = pop(@$optionlistref); 149 my $pluginarguments = $pluginoptions->{'args'}; 150 150 return $pluginarguments; 151 151 } … … 154 154 sub print_xml_usage 155 155 { 156 local$self = shift(@_);156 my $self = shift(@_); 157 157 158 158 # XML output is always in UTF-8 … … 166 166 sub print_xml 167 167 { 168 local$self = shift(@_);169 170 local$optionlistref = $self->{'option_list'};171 local@optionlist = @$optionlistref;172 local$pluginoptions = pop(@$optionlistref);168 my $self = shift(@_); 169 170 my $optionlistref = $self->{'option_list'}; 171 my @optionlist = @$optionlistref; 172 my $pluginoptions = pop(@$optionlistref); 173 173 return if (!defined($pluginoptions)); 174 174 … … 197 197 sub print_txt_usage 198 198 { 199 local$self = shift(@_);199 my $self = shift(@_); 200 200 201 201 # Print the usage message for a plugin (recursively) 202 local$descoffset = $self->determine_description_offset(0);202 my $descoffset = $self->determine_description_offset(0); 203 203 $self->print_plugin_usage($descoffset, 1); 204 204 } … … 207 207 sub determine_description_offset 208 208 { 209 local$self = shift(@_);210 local$maxoffset = shift(@_);211 212 local$optionlistref = $self->{'option_list'};213 local@optionlist = @$optionlistref;214 local$pluginoptions = pop(@$optionlistref);209 my $self = shift(@_); 210 my $maxoffset = shift(@_); 211 212 my $optionlistref = $self->{'option_list'}; 213 my @optionlist = @$optionlistref; 214 my $pluginoptions = pop(@$optionlistref); 215 215 return $maxoffset if (!defined($pluginoptions)); 216 216 217 217 # Find the length of the longest option string of this plugin 218 local$pluginargs = $pluginoptions->{'args'};218 my $pluginargs = $pluginoptions->{'args'}; 219 219 if (defined($pluginargs)) { 220 local$longest = &PrintUsage::find_longest_option_string($pluginargs);220 my $longest = &PrintUsage::find_longest_option_string($pluginargs); 221 221 if ($longest > $maxoffset) { 222 222 $maxoffset = $longest; … … 233 233 sub print_plugin_usage 234 234 { 235 local$self = shift(@_);236 local$descoffset = shift(@_);237 local$isleafclass = shift(@_);238 239 local$optionlistref = $self->{'option_list'};240 local@optionlist = @$optionlistref;241 local$pluginoptions = pop(@$optionlistref);235 my $self = shift(@_); 236 my $descoffset = shift(@_); 237 my $isleafclass = shift(@_); 238 239 my $optionlistref = $self->{'option_list'}; 240 my @optionlist = @$optionlistref; 241 my $pluginoptions = pop(@$optionlistref); 242 242 return if (!defined($pluginoptions)); 243 243 244 local$pluginname = $pluginoptions->{'name'};245 local$pluginargs = $pluginoptions->{'args'};246 local$plugindesc = $pluginoptions->{'desc'};244 my $pluginname = $pluginoptions->{'name'}; 245 my $pluginargs = $pluginoptions->{'args'}; 246 my $plugindesc = $pluginoptions->{'desc'}; 247 247 248 248 # Produce the usage information using the data structure above … … 257 257 if (defined($pluginargs)) { 258 258 # Calculate the column offset of the option descriptions 259 local$optiondescoffset = $descoffset + 2; # 2 spaces between options & descriptions259 my $optiondescoffset = $descoffset + 2; # 2 spaces between options & descriptions 260 260 261 261 if ($isleafclass) { … … 486 486 487 487 $self->extra_metadata ($doc_obj, $doc_obj->get_top_section(), $metadata); 488 488 489 489 # do plugin specific processing of doc_obj 490 return -1 unless defined ($self->process (\$text, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli)); 491 490 unless (defined ($self->process (\$text, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli))) { 491 $text = ''; 492 undef $text; 493 return -1; 494 } 495 $text=''; 496 undef $text; 497 492 498 # do any automatic metadata extraction 493 499 $self->auto_extract_metadata ($doc_obj); … … 495 501 # add an OID 496 502 # see if there is a plugin-specific set_OID function... 497 if (defined ($self->can( set_OID))) {503 if (defined ($self->can('set_OID'))) { 498 504 # it will need $doc_obj to set the Identifier metadata... 499 505 $self->set_OID($doc_obj); … … 507 513 508 514 $self->{'num_processed'} ++; 509 515 undef $doc_obj; 510 516 return 1; # processed the file 511 517 }
Note:
See TracChangeset
for help on using the changeset viewer.