Changeset 32812
- Timestamp:
- 2019-02-25T22:06:06+13:00 (5 years ago)
- Location:
- main/trunk/model-sites-dev/heritage-nz/collect/reports-2019/perllib/plugins
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-sites-dev/heritage-nz/collect/reports-2019/perllib/plugins/CSVPlugin.pm
r32810 r32812 29 29 use SplitTextFile; 30 30 use MetadataRead; 31 use CSVFieldSeparator; 32 31 33 use strict; 32 34 no strict 'refs'; # allow filehandles to be variables and viceversa … … 36 38 # CSVPlugin is a sub-class of SplitTextFile. 37 39 sub BEGIN { 38 @CSVPlugin::ISA = ('MetadataRead', 'SplitTextFile' );40 @CSVPlugin::ISA = ('MetadataRead', 'SplitTextFile', 'CSVFieldSeparator'); 39 41 } 40 42 … … 42 44 my $arguments = 43 45 [ 44 { 'name' => "separate_char",45 'desc' => "{CSVPlugin.separate_char}",46 'type' => "string",47 'deft' => "auto",48 'reqd' => "no" },49 46 { 'name' => "process_exp", 50 47 'desc' => "{BaseImporter.process_exp}", … … 90 87 push(@{$hashArgOptLists->{"OptList"}}, $options); 91 88 89 new CSVFieldSeparator($pluginlist, $inputargs, $hashArgOptLists); 92 90 my $self = new SplitTextFile($pluginlist, $inputargs, $hashArgOptLists); 93 91 … … 120 118 my $separate_char = $self->{'separate_char'}; 121 119 if ($separate_char =~ m/^auto$/i) { 122 $separate_char = CSVSeparateChar::resolve_auto($csv_file_field_line,$self->{'plugin_type'},$self->{'outhandle'},$self->{'verbosity'});120 $separate_char = $self->resolve_auto($csv_file_field_line,$self->{'plugin_type'},$self->{'outhandle'},$self->{'verbosity'}); 123 121 # Replace the 'auto' setting the resolved value (for use later on) 124 122 $self->{'separate_char'} = $separate_char; -
main/trunk/model-sites-dev/heritage-nz/collect/reports-2019/perllib/plugins/MetadataCSVPlugin.pm
r32810 r32812 30 30 use BaseImporter; 31 31 use MetadataRead; 32 use CSVFieldSeparator; 32 33 33 34 use strict; … … 38 39 use util; 39 40 40 use CSVSeparateChar;41 42 41 use Encode; 42 use Text::CSV; 43 43 44 44 # methods with identical signatures take precedence in the order given in the ISA list. 45 45 sub BEGIN { 46 @MetadataCSVPlugin::ISA = ('MetadataRead', 'BaseImporter' );46 @MetadataCSVPlugin::ISA = ('MetadataRead', 'BaseImporter', 'CSVFieldSeparator'); 47 47 } 48 48 … … 50 50 51 51 my $arguments = [ 52 { 'name' => "separate_char",53 'desc' => "{CSVPlugin.separate_char}",54 'type' => "string",55 'deft' => "auto",56 'reqd' => "no" },57 52 { 'name' => "process_exp", 58 53 'desc' => "{BaseImporter.process_exp}", … … 80 75 push(@{$hashArgOptLists->{"OptList"}},$options); 81 76 77 new CSVFieldSeparator($pluginlist, $inputargs, $hashArgOptLists); 82 78 my $self = new BaseImporter($pluginlist, $inputargs, $hashArgOptLists); 83 79 … … 154 150 155 151 if ($separate_char =~ m/^auto$/i) { 156 $separate_char = CSVSeparateChar::resolve_auto($csv_file_field_line,$self->{'plugin_type'},$outhandle,$self->{'verbosity'});152 $separate_char = $self->resolve_auto($csv_file_field_line,$self->{'plugin_type'},$outhandle,$self->{'verbosity'}); 157 153 } 158 154
Note:
See TracChangeset
for help on using the changeset viewer.