Skip to content

Commit 0c2e85e

Browse files
committed
Merge branch 'turn_off_warnings_on_webservice' into update_clients_take2
Conflicts: .gitignore clients/renderProblem.pl
2 parents 84a5bba + 5bd1155 commit 0c2e85e

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

clients/renderProblem.pl

+48
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ =head1 NAME
185185
{
186186
local($/);
187187
$source = <>; #slurp standard input
188+
<<<<<<< HEAD
188189
#print $source; # return input to BBedit
190+
=======
191+
print $source; # return input to BBedit
192+
>>>>>>> turn_off_warnings_on_webservice
189193
190194
}
191195
############################################
@@ -220,6 +224,7 @@ =head1 NAME
220224
$output = $xmlrpc_client->formatRenderedProblem;
221225
###HACK fixme
222226
print pretty_print_rh($result) if $UNIT_TESTS_ON;
227+
223228
} else {
224229
print "\n\n ERRORS in renderProblem \n\n";
225230
$output = $xmlrpc_client->{output}; # error report
@@ -235,6 +240,46 @@ =head1 NAME
235240
##################################################
236241
# end input/output section
237242
##################################################
243+
sub pretty_print_rh {
244+
shift if UNIVERSAL::isa($_[0] => __PACKAGE__);
245+
my $rh = shift;
246+
my $indent = shift || 0;
247+
my $out = "";
248+
my $type = ref($rh);
249+
250+
if (defined($type) and $type) {
251+
$out .= " type = $type; ";
252+
} elsif (! defined($rh )) {
253+
$out .= " type = UNDEFINED; ";
254+
}
255+
return $out." " unless defined($rh);
256+
257+
if ( ref($rh) =~/HASH/ or "$rh" =~/HASH/ ) {
258+
$out .= "{\n";
259+
$indent++;
260+
foreach my $key (sort keys %{$rh}) {
261+
$out .= " "x$indent."$key => " . pretty_print_rh( $rh->{$key}, $indent ) . "\n";
262+
}
263+
$indent--;
264+
$out .= "\n"." "x$indent."}\n";
265+
266+
} elsif (ref($rh) =~ /ARRAY/ or "$rh" =~/ARRAY/) {
267+
$out .= " ( ";
268+
foreach my $elem ( @{$rh} ) {
269+
$out .= pretty_print_rh($elem, $indent);
270+
271+
}
272+
$out .= " ) \n";
273+
} elsif ( ref($rh) =~ /SCALAR/ ) {
274+
$out .= "scalar reference ". ${$rh};
275+
} elsif ( ref($rh) =~/Base64/ ) {
276+
$out .= "base64 reference " .$$rh;
277+
} else {
278+
$out .= $rh;
279+
}
280+
281+
return $out." ";
282+
}
238283
239284
sub pretty_print_rh {
240285
shift if UNIVERSAL::isa($_[0] => __PACKAGE__);
@@ -277,5 +322,8 @@ sub pretty_print_rh {
277322
return $out." ";
278323
}
279324
325+
<<<<<<< HEAD
280326
327+
=======
328+
>>>>>>> turn_off_warnings_on_webservice
281329
1;

0 commit comments

Comments
 (0)