Commit 3f3d6c82 authored by Leo Gordon's avatar Leo Gordon
Browse files

went back to printing toString() when registering new Cacheable objects

parent 513dfa4e
......@@ -243,7 +243,7 @@ sub dataflow_rules_collection {
sub toString {
my $self = shift @_;
return ('Analysis: '.join(', ', map { $_.'="'.$self->$_().'"' } qw(dbID logic_name module parameters) ));
return 'Analysis['.($self->dbID // '').']: '.$self->display_name.'->('.join(', ', $self->module, $self->parameters, $self->resource_class->name).')';
}
1;
......
......@@ -153,11 +153,9 @@ sub toString {
my $self = shift;
return join('',
'AnalysisCtrlRule',
# '(dbID=', ($self->dbID || '?'), ')', # this object doesn't have a dbID
': ',
'AnalysisCtrlRule: ',
$self->condition_analysis_url,
' -| ',
' ---| ',
$self->ctrled_analysis->logic_name,
);
}
......
......@@ -50,8 +50,6 @@ sub add_new_or_update {
} else {
warn "Found a matching $class (".Dumper(\%unikey_pairs).")\n";
}
} else {
warn "Creating a new $class (".Dumper(\%unikey_pairs).")\n";
}
} else {
warn "$class doesn't redefine unikey(), so unique objects cannot be identified";
......@@ -60,8 +58,10 @@ sub add_new_or_update {
unless( $self ) {
if( $class->can('new') ) {
$self = $class->new( @_ );
warn "Created a new ".$self->toString."\n";
} else {
$self = { @_ };
warn "Created a new naked entry ".stringify($self)."\n";
}
$class->collection()->add( $self );
......
......@@ -192,19 +192,22 @@ sub to_analysis {
=cut
sub toString {
my $self = shift;
my $self = shift @_;
my $short = shift @_;
return join('',
'DataflowRule(dbID=',
($self->dbID || '?'),
($self->funnel_dataflow_rule_id ? ' --|| '.$self->funnel_dataflow_rule_id : ''),
'): [#',
$short ? () : (
'DataflowRule[',
($self->dbID // ''),
']: ',
$self->from_analysis->logic_name,
),
' --#',
$self->branch_code,
'] ',
$self->from_analysis->logic_name,
' -> ',
'--> ',
$self->to_analysis_url,
($self->input_id_template ? (' WITH TEMPLATE: '.$self->input_id_template) : ''),
($self->funnel_dataflow_rule ? ' ---|| ('.$self->funnel_dataflow_rule->toString(1).' )' : ''),
);
}
......
......@@ -60,7 +60,7 @@ sub name {
sub toString {
my $self = shift @_;
return ('ResourceClass: '.join(', ', map { $_.'="'.$self->$_().'"' } qw(dbID name) ));
return 'ResourceClass['.($self->dbID // '').']: '.$self->name;
}
1;
......
......@@ -89,7 +89,7 @@ sub worker_cmd_args {
sub toString {
my $self = shift @_;
return ('ResourceDescription: '.join(', ', map { $_.'="'.$self->$_().'"' } qw(resource_class_id meadow_type submission_cmd_args worker_cmd_args) ));
return 'ResourceDescription: ('.$self->resource_class->name.', '.$self->meadow_type.')->("'.$self->submission_cmd_args.'", "'.$self->worker_cmd_args.'")';
}
1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment