/[webpac2]/trunk/lib/WebPAC/Validate.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Validate.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 838 by dpavlin, Thu May 24 14:42:35 2007 UTC revision 843 by dpavlin, Fri May 25 19:49:39 2007 UTC
# Line 67  sub new { Line 67  sub new {
67          my $self = {@_};          my $self = {@_};
68          bless($self, $class);          bless($self, $class);
69    
 warn dump( @_ );  
   
70          my $log = $self->_get_logger();          my $log = $self->_get_logger();
71    
72            $log->logdie("need path or delimiters_path") unless ( $self->{path} || $self->{delimiters_path} );
73    
74          if ( $self->{path} ) {          if ( $self->{path} ) {
75    
76                  my $v_file = read_file( $self->{path} ) ||                  my $v_file = read_file( $self->{path} ) ||
# Line 140  warn dump( @_ ); Line 140  warn dump( @_ );
140                                  }                                  }
141                          }                          }
142                          close($d);                          close($d);
143                          warn "_validate_delimiters_templates = ",dump( $self->{_validate_delimiters_templates} );                          #warn "_validate_delimiters_templates = ",dump( $self->{_validate_delimiters_templates} );
144                  } else {                  } else {
145                          $log->warn("delimiters path $path doesn't exist, it will be created after this run");                          $log->warn("delimiters path $path doesn't exist, it will be created after this run");
146                  }                  }
# Line 194  sub validate_rec { Line 194  sub validate_rec {
194    
195                                          if ( my $v = $self->{_validate_delimiters_templates} ) {                                          if ( my $v = $self->{_validate_delimiters_templates} ) {
196                                                  if ( ! defined( $v->{$f}->{$template} ) ) {                                                  if ( ! defined( $v->{$f}->{$template} ) ) {
197                                                          $errors->{$f}->{invalid_delimiters_combination} = $template;                                                          $errors->{$f}->{potentially_invalid_combination} = $template;
198                                                          $errors->{$f}->{dump} = $subfield_dump;                                                          $errors->{$f}->{dump} = $subfield_dump;
199                                                  #} else {                                                  #} else {
200                                                  #       warn "## $f $template ok\n";                                                  #       warn "## $f $template ok\n";
# Line 505  sub save_delimiters_templates { Line 505  sub save_delimiters_templates {
505    
506          my $log = $self->_get_logger;          my $log = $self->_get_logger;
507    
508            $path .= '.new' if ( -e $path );
509    
510          open(my $d, '>', $path) || $log->fatal("can't open $path: $!");          open(my $d, '>', $path) || $log->fatal("can't open $path: $!");
511          print $d $self->delimiters_templates;          print $d $self->delimiters_templates;
512          close($d);          close($d);

Legend:
Removed from v.838  
changed lines
  Added in v.843

  ViewVC Help
Powered by ViewVC 1.1.26