Changeset 11680
- Timestamp:
- 2006-04-21T15:19:32+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/ConvertToPlug.pm
r11090 r11680 41 41 use strict; 42 42 no strict 'refs'; # allow filehandles to be variables and viceversa 43 43 no strict 'subs'; 44 44 sub BEGIN { 45 45 @ConvertToPlug::ISA = ('BasPlug'); … … 100 100 my @convert_to_list = split(",",$self->{'convert_to'}); 101 101 my $secondary_plugins = {}; 102 # find the plugin 102 103 103 104 foreach my $convert_to (@convert_to_list) { … … 106 107 my $plugin_package = $plugin_class.".pm"; 107 108 108 require $plugin_package; 109 my $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, 110 "perllib/plugins", 111 $plugin_package); 112 my $mainplugname = &util::filename_cat($ENV{'GSDLHOME'}, 113 "perllib/plugins", 114 $plugin_package); 115 116 if (-e $colplugname) {require $colplugname;} 117 elsif (-e $mainplugname) { require $mainplugname; } 118 else { 119 &gsprintf(STDERR, "{plugin.could_not_find_plugin}\n", 120 $plugin_class); 121 die "\n"; 122 } 109 123 110 124 # call its constructor with extra options that we've worked out! 111 125 my $arglist = $input_args->{$plugin_class}; 112 # my $secondary_plugin = new $plugin_class([],$arglist, $hashArgOptLists); 113 # secondary plugins don';t need to know their calling plugin's options 114 my $secondary_plugin = new $plugin_class([],$arglist); 126 127 my ($secondary_plugin); 128 eval("\$secondary_plugin = new $plugin_class([],\$arglist)"); 129 die "$@" if $@; 115 130 $secondary_plugins->{$plugin_class} = $secondary_plugin; 116 131 } … … 128 143 my $self = (defined $hashArgOptLists)? new BasPlug($pluginlist,$inputargs,$hashArgOptLists): new BasPlug($pluginlist,$inputargs); 129 144 145 if ($self->{'info_only'}) { 146 # don't worry about any options etc 147 return bless $self, $class; 148 } 149 130 150 my $convert_to_type = $self->{'convert_to'}; 131 151 if (!defined $convert_to_type || $convert_to_type eq "") {
Note:
See TracChangeset
for help on using the changeset viewer.