Changeset 10579
- Timestamp:
- 2005-08-29T10:38:07+12:00 (19 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugin.pm
r10482 r10579 28 28 use strict; # to pick up typos and undeclared variables... 29 29 no strict 'refs'; # ...but allow filehandles to be variables and vice versa 30 no strict 'subs'; 30 31 31 32 require util; … … 42 43 #globaloptions contains any options that should be passed to all plugins 43 44 my ($verbosity, $outhandle, $failhandle, $globaloptions); 45 46 sub load_plugin_for_info { 47 my ($pluginname) = shift @_; 48 49 # find the plugin 50 my $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"perllib/plugins", 51 "${pluginname}.pm"); 52 my $mainplugname = &util::filename_cat($ENV{'GSDLHOME'},"perllib/plugins", 53 "${pluginname}.pm"); 54 if (-e $colplugname) { require $colplugname; } 55 elsif (-e $mainplugname) { require $mainplugname; } 56 else { 57 &gsprintf(STDERR, "{plugin.could_not_find_plugin}\n", 58 $pluginname); 59 die "\n"; 60 } 61 62 # create a plugin object 63 my ($plugobj); 64 my $options = "-gsdlinfo"; 65 66 eval ("\$plugobj = new \$pluginname([],[$options])"); 67 die "$@" if $@; 68 69 return $plugobj; 70 } 44 71 45 72 sub load_plugins { -
trunk/gsdl/perllib/plugins/BasPlug.pm
r10478 r10579 381 381 382 382 my $self = {}; 383 $self->{'outhandle'} = STDERR; 384 $self->{'option_list'} = $hashArgOptLists->{"OptList"}; 385 $self->{"info_only"} = 0; 386 387 # Check if gsdlinfo is in the argument list or not - if it is, don't parse 388 # the args, just return the object. 389 foreach my $strArg (@{$args}) 390 { 391 if($strArg eq "-gsdlinfo") 392 { 393 $self->{"info_only"} = 1; 394 return bless $self, $class; 395 } 396 } 397 383 398 if(!parse2::parse($args,$hashArgOptLists->{"ArgList"},$self)) 384 399 { … … 390 405 391 406 407 delete $self->{"info_only"}; 392 408 # else parsing was successful. 393 409 394 410 $self->{'plugin_type'} = $plugin_name; 395 $self->{'outhandle'} = STDERR;411 #$self->{'outhandle'} = STDERR; 396 412 $self->{'textcat'} = new textcat(); 397 413 $self->{'num_processed'} = 0; … … 402 418 $self->{'cover_image'} = 0 if ($self->{'no_cover_image'}); 403 419 $self->{'file_blocks'} = {}; 404 $self->{'option_list'} = $hashArgOptLists->{"OptList"};420 #$self->{'option_list'} = $hashArgOptLists->{"OptList"}; 405 421 406 422 my $associate_ext = $self->{'associate_ext'};
Note:
See TracChangeset
for help on using the changeset viewer.