Skip to content

Commit

Permalink
CHANGED: text output goes to STDERR
Browse files Browse the repository at this point in the history
  • Loading branch information
nkh committed Dec 6, 2023
1 parent 14ea12e commit f40eda1
Show file tree
Hide file tree
Showing 18 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion Astar/path_finder
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ if($options->{info})
if($options->{stats})
{
use Data::TreeDumper ;
print DumpTree \%stats, "stats:", DISPLAY_ADDRESS => 0 ;
print STDERR DumpTree \%stats, "stats:", DISPLAY_ADDRESS => 0 ;
}

if($options->{json})
Expand Down
4 changes: 2 additions & 2 deletions lib/App/Asciio/Actions/Clipboard.pm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ for my $option (@clipboard_out_options)
{
my $elements_base64 = qx~xsel $option -o~ ;

# print "get data:==>" . $elements_base64 . "\n" ;
# print STDERR "get data:==>" . $elements_base64 . "\n" ;

$elements_serail = MIME::Base64::decode_base64($elements_base64) ;

Expand All @@ -135,7 +135,7 @@ for my $option (@clipboard_out_options)
}
else
{
print "data from $option is invalid!\n" ;
print STDERR "data from $option is invalid!\n" ;
}
}

Expand Down
6 changes: 3 additions & 3 deletions lib/App/Asciio/Actions/Debug.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ my $size = sum(map { length } @{$self->{DO_STACK}}) || 0 ;

local $self->{DO_STACK} = scalar(@{$self->{DO_STACK}}) . " [$size]";

#~ print Data::TreeDumper::DumpTree $self ;
#~ print STDERR Data::TreeDumper::DumpTree $self ;
$self->show_dump_window($self, 'asciio') ;
}

Expand All @@ -25,7 +25,7 @@ sub dump_selected_elements
{
my ($self) = @_ ;

#~ print Data::TreeDumper::DumpTree [$self->get_selected_elements(1)] ;
#~ print STDERR Data::TreeDumper::DumpTree [$self->get_selected_elements(1)] ;
$self->show_dump_window([$self->get_selected_elements(1)], 'asciio selected elements') ;
}

Expand All @@ -35,7 +35,7 @@ sub dump_all_elements
{
my ($self) = @_ ;

#~ print Data::TreeDumper::DumpTree $self->{ELEMENTS} ;
#~ print STDERR Data::TreeDumper::DumpTree $self->{ELEMENTS} ;
$self->show_dump_window($self->{ELEMENTS}, 'asciio elements') ;
}

Expand Down
24 changes: 12 additions & 12 deletions lib/App/Asciio/Actions/Presentation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ sub run_slide
my ($self, $slide) = @_ ;

# use Data::TreeDumper ;
# print DumpTree \@stack, 'stack:' ;
# print STDERR DumpTree \@stack, 'stack:' ;

if(defined $slide)
{
for my $element ($slide->@*)
{
# print "running element: $element '" . ref($element) . "' $slide\n" ;
# print STDERR "running element: $element '" . ref($element) . "' $slide\n" ;

if('' eq ref($element))
{
Expand All @@ -57,7 +57,7 @@ if(defined $slide)

if('ARRAY' eq ref($element))
{
# print "PUSH $element\n" ;
# print STDERR "PUSH $element\n" ;

push @stack, [0, $element] ;
run_slide($self, $element) ;
Expand All @@ -68,7 +68,7 @@ if(defined $slide)
if('HASH' eq ref($element))
{
$stack[-1][2] = $element ;
print "Asciio: slide has scripts\n" ;
print STDERR "Asciio: slide has scripts\n" ;
}

$stack[-1][0]++ ;
Expand All @@ -86,18 +86,18 @@ if(@stack)
{
my ($index, $slide) = $stack[-1]->@* ;

# print "$index < " . $slide->@* . "\n" ;
# print STDERR "$index < " . $slide->@* . "\n" ;

if($index < $slide->@*)
{
# print "NEXT\n" ;
# print STDERR "NEXT\n" ;
$stack[-1][0]++ ;

my $next_slide = $slide->[$index + 1] ;

if('ARRAY' eq ref($next_slide))
{
# print "PUSH $next_slide\n" ;
# print STDERR "PUSH $next_slide\n" ;
push @stack, [0, $next_slide] ;
}

Expand All @@ -107,7 +107,7 @@ if(@stack)
{
if(@stack > 1)
{
# print "POP\n" ;
# print STDERR "POP\n" ;
pop @stack ;

next_slide($self) ;
Expand All @@ -122,8 +122,8 @@ sub previous_slide
{
my ($self) = @_ ;

use Data::TreeDumper ;
print DumpTree \@stack, 'stack:' ;
# use Data::TreeDumper ;
# print STDERR DumpTree \@stack, 'stack:' ;

if(@stack)
{
Expand All @@ -133,8 +133,8 @@ if(@stack)
my $slides = $stack[0][1] ;
my $index = $stack[0][0] >= $stack[0][1]->@* ? $stack[0][0] - 2 : $stack[0][0] - 1 ;

print "new index: $index\n" ;

# print STDERR "new index: $index\n" ;
if($index >= 0)
{
$stack[0][0] = $index ;
Expand Down
8 changes: 4 additions & 4 deletions lib/App/Asciio/Actions/Unsorted.pm
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ sub display_commands
{
my ($self) = @_ ;

#~ print Data::TreeDumper::DumpTree $self->{ACTIONS_BY_NAME}, 'ACTIONS_BY_NAME:';
#~ print STDERR Data::TreeDumper::DumpTree $self->{ACTIONS_BY_NAME}, 'ACTIONS_BY_NAME:';

my $commands = get_commands($self->{ACTIONS_BY_NAME}) ;

Expand Down Expand Up @@ -338,8 +338,8 @@ for my $action (keys %{$key_mapping})
generate_keyboard_mapping_text_dump($key_mapping->{$action}, $sub_actions) ;
}

#~ print Data::TreeDumper::DumpTree $key_mapping->{$action} ;
#~ print Data::TreeDumper::DumpTree $sub_actions ;
#~ print STDERR Data::TreeDumper::DumpTree $key_mapping->{$action} ;
#~ print STDERR Data::TreeDumper::DumpTree $sub_actions ;

my $shortcuts = $key_mapping->{$action}{SHORTCUTS} ;
$shortcuts = join(' ', @{$key_mapping->{$action}{SHORTCUTS}})
Expand All @@ -350,7 +350,7 @@ for my $action (keys %{$key_mapping})
}
else
{
#~ print Data::TreeDumper::DumpTree $key_mapping->{$action}, $action ;
#~ print STDERR Data::TreeDumper::DumpTree $key_mapping->{$action}, $action ;
#~ die "unknown type while running 'dump_keyboard_mapping'\n" ;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/App/Asciio/Arrows.pm
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,6 @@ if(exists $arrow_types{$data->{TYPE}})
}
}

sub clone { my ($type) = @_ ; print "cloning arrow $type\n" ; Clone::clone($arrow_types{$type}) ; }
sub clone { my ($type) = @_ ; print STDERR "cloning arrow $type\n" ; Clone::clone($arrow_types{$type}) ; }

}
16 changes: 8 additions & 8 deletions lib/App/Asciio/Dialogs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sub show_dump_window
{
my ($self, $data, $title, @dumper_setup) = @_ ;

print DumpTree $data, $title, @dumper_setup ;
print STDERR DumpTree $data, $title, @dumper_setup ;
}

#-----------------------------------------------------------------------------
Expand All @@ -31,7 +31,7 @@ sub display_message_modal
{
my ($self, $message) = @_ ;

print $message ;
print STDERR $message ;
}

#-----------------------------------------------------------------------------
Expand All @@ -40,9 +40,9 @@ sub display_yes_no_cancel_dialog
{
my ($self, $title, $text) = @_ ;

print "$title\n$text\n" ;
print STDERR "$title\n$text\n" ;

print "Yes/No/Cancel\n" ;
print STDERR "Yes/No/Cancel\n" ;
my $answer = <STDIN> ;
chomp ($answer) ;

Expand All @@ -55,8 +55,8 @@ sub display_quit_dialog
{
my ($self, $title, $text) = @_ ;

print "$title\n$text\n" ;
print "Yes/No/Cancel\n" ;
print STDERR "$title\n$text\n" ;
print STDERR "Yes/No/Cancel\n" ;

my $answer = <STDIN> ;
chomp ($answer) ;
Expand All @@ -68,7 +68,7 @@ sub display_edit_dialog
{
my ($self, $title, $text) = @_ ;

print "$title\n$text\n" ;
print STDERR "$title\n$text\n" ;

my $answer = <STDIN> ;
chomp ($answer) ;
Expand All @@ -82,7 +82,7 @@ sub get_file_name
{
my ($self, $title, $mode, $directory) = @_ ;

print "get_file_name:\n" ;
print STDERR "get_file_name:\n" ;

my $answer = <STDIN> ;
chomp ($answer) ;
Expand Down
6 changes: 3 additions & 3 deletions lib/App/Asciio/GTK/Asciio.pm
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ my ($widget_width, $widget_height) = ($widget->get_allocated_width(), $widget->g
# use Data::TreeDumper ;

# my $neighbors = $zbuffer->get_neighbors_stack($coordinate) ;
# print DumpTree { stack => $elements, neighbors => $neighbors }, $coordinate ;
# print STDERR DumpTree { stack => $elements, neighbors => $neighbors }, $coordinate ;
# }

my $grid_rendering = $self->{CACHE}{GRID} ;
Expand Down Expand Up @@ -593,7 +593,7 @@ for (@overlay_elements)
{
if(! defined $_)
{
print "GTK::Asciio: got undef\n" ;
print STDERR "GTK::Asciio: got undef\n" ;
}
elsif(ref $_ eq 'ARRAY')
{
Expand Down Expand Up @@ -621,7 +621,7 @@ for (@overlay_elements)
}
else
{
print "GTK::Asciio: got someting else " . ref($_) . "\n" ;
print STDERR "GTK::Asciio: got someting else " . ref($_) . "\n" ;
}
}
# draw hint_lines
Expand Down
2 changes: 1 addition & 1 deletion lib/App/Asciio/GTK/Asciio/DnD.pm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $window->drag_dest_set_target_list($target_list) ;

$window->signal_connect(drag_data_received => \&drag_data_received_cb, $self) ;

# $window->signal_connect(drag_motion => sub{ print "drag_motion\n"}, $self) ;
# $window->signal_connect(drag_motion => sub{ print STDERR "drag_motion\n"}, $self) ;
$window->signal_connect(drag_end => sub { $self->{IN_DRAG_DROP} = 0 ; }, $self);

$window->signal_connect(drag_data_get => \&drag_data_get_cb, $self) ;
Expand Down
2 changes: 1 addition & 1 deletion lib/App/Asciio/GTK/Asciio/Menues.pm
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ for my $context_menu_handler
} sort keys %{$self->{ACTIONS}}
)
{
# print "Adding context menu from action '$context_menu_handler->{NAME}'.\n" ;
# print STDERR "Adding context menu from action '$context_menu_handler->{NAME}'.\n" ;

if(defined $context_menu_handler->{CONTEXT_MENU_ARGUMENTS})
{
Expand Down
2 changes: 1 addition & 1 deletion lib/App/Asciio/Io.pm
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ for my $new_element (@{$elements})
{
if(exists $self->{ELEMENT_TYPES_BY_NAME}{$new_element->{NAME}})
{
print "Overriding element type '$new_element->{NAME}'!\n" ;
print STDERR "Overriding element type '$new_element->{NAME}'!\n" ;
$self->{ELEMENT_TYPES}[$self->{ELEMENT_TYPES_BY_NAME}{$new_element->{NAME}}]
= $new_element ;
}
Expand Down
10 changes: 5 additions & 5 deletions lib/App/Asciio/Scripting.pm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ use App::Asciio::stripes::wirl_arrow ;
use Digest::MD5 qw(md5_hex) ;

use Data::TreeDumper ;
sub ddt { print DumpTree @_ ; }
sub ddt { print STDERR DumpTree @_ ; }

use App::Asciio::Actions::Colors ;

Expand All @@ -91,16 +91,16 @@ if(defined $script)
{
$external_script_run++ ;

print "Asciio: script [$external_script_run]: " . md5_hex($script) . ' ' . length($script) . "\n" ;
print "$script\n" if $show_script ;
print STDERR "Asciio: script [$external_script_run]: " . md5_hex($script) . ' ' . length($script) . "\n" ;
print STDERR "$script\n" if $show_script ;

$script_asciio = $asciio ;

eval $script ;

$asciio->update_display() ;

print "Asciio: error running script: $@ \n" if $@ ;
print STDERR "Asciio: error running script: $@ \n" if $@ ;
}
}

Expand All @@ -112,7 +112,7 @@ $file //= $asciio->get_file_name() ;

if(defined $file)
{
print "Asciio: script file: '$file'\n" ;
print STDERR "Asciio: script file: '$file'\n" ;

$script_asciio = $asciio ;

Expand Down
12 changes: 6 additions & 6 deletions lib/App/Asciio/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ else
$to_parent->autoflush(1) ;

my $daemon = HTTP::Daemon->new(ReusePort => 1, LocalAddr => 'localhost', LocalPort => $port) or die "Server: Error: can't start server\n" ;
print "Asciio: running HTTP server on port $port\n" ;
print STDERR "Asciio: running HTTP server on port $port\n" ;

$SIG{INT} = sub {
# print "Asciio: Server received SIGINT\n" ;
# print STDERR "Asciio: Server received SIGINT\n" ;
undef $daemon ;
} ;

$SIG{TERM} = sub
{
# print "Asciio: Server received SIGTERM\n" ;
# print STDERR "Asciio: Server received SIGTERM\n" ;
undef $daemon ;
} ;

Expand All @@ -113,7 +113,7 @@ else
{
my $path = $rq->uri->path ;

# print "Asciio: Http: " . $rq->method . ' ' . $daemon->url . "$path, count: $counter - $$\n" ;
# print STDERR "Asciio: Http: " . $rq->method . ' ' . $daemon->url . "$path, count: $counter - $$\n" ;

if ($rq->method eq 'GET')
{
Expand All @@ -126,7 +126,7 @@ else
my $parser = HTTP::Request::Params->new({req => $rq}) ;
my $parameters = $parser->params() ;

# '/' eq $path && print "Asciio:: Web server: POST\n" . DumpTree($parameters) ;
# '/' eq $path && print STDERR "Asciio:: Web server: POST\n" . DumpTree($parameters) ;

my $request_json = JSON->new->allow_nonref->canonical(1)->pretty->encode({ PATH => $path, PARAMETERS => $parameters}) ;

Expand All @@ -146,7 +146,7 @@ else

'/stop' eq $path && $stop++ ;

# '/' eq $path && print "Asciio:: Web server: PUT\n" . DumpTree($parameters) ;
# '/' eq $path && print STDERR "Asciio:: Web server: PUT\n" . DumpTree($parameters) ;

my $request_json = JSON->new->allow_nonref->canonical(1)->pretty->encode({ PATH => $path, PARAMETERS => $parameters}) ;
my $size = length($request_json) ;
Expand Down
2 changes: 1 addition & 1 deletion lib/App/Asciio/Text/Asciio/Menues.pm
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ for my $context_menu_handler
} sort keys %{$self->{CURRENT_ACTIONS}}
)
{
# print "Adding context menu from action '$context_menu_handler->{NAME}'.\n" ;
# print STDERR "Adding context menu from action '$context_menu_handler->{NAME}'.\n" ;

if(defined $context_menu_handler->{CONTEXT_MENU_ARGUMENTS})
{
Expand Down
Loading

0 comments on commit f40eda1

Please sign in to comment.