cvs commit: p5ee/App-Context/lib/App Context.pm

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     04/11/10 07:39:24

  Modified:    App-Context/lib/App Context.pm
  Log:
  log() doesn't autoappend newline. change behavior if no method supplied.
  
  Revision  Changes    Path
  1.18      +16 -13    p5ee/App-Context/lib/App/Context.pm
  
  Index: Context.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Context/lib/App/Context.pm,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Context.pm	28 Sep 2004 15:20:09 -0000	1.17
  +++ Context.pm	10 Nov 2004 15:39:24 -0000	1.18
  @@ -1,6 +1,6 @@
   
   #############################################################################
  -## $Id: Context.pm,v 1.17 2004/09/28 15:20:09 spadkins Exp $
  +## $Id: Context.pm,v 1.18 2004/11/10 15:39:24 spadkins Exp $
   #############################################################################
   
   package App::Context;
  @@ -918,6 +918,7 @@
   sub so_set {
       &App::sub_entry if ($App::trace);
       my ($self, $name, $var, $value) = @_;
  +
       my ($perl, $retval);
   
       if ($value eq "{:delete:}") {
  @@ -1256,7 +1257,7 @@
   sub log {
       &App::sub_entry if ($App::trace);
       my $self = shift;
  -    print STDERR @_, "\n";
  +    print STDERR @_;
       &App::sub_exit() if ($App::trace);
   }
   
  @@ -1672,17 +1673,15 @@
           while ($#$events > -1) {
               $event = shift(@$events);
               ($service, $name, $method, $args) = @$event;
  -            if ($service eq "SessionObject") {
  -                $self->call($service, $name, $method, $args);
  -            }
  -            else {
  -                $results = $self->call($service, $name, $method, $args);
  -                $show_current_session_object = 0;
  -            }
  +            $results = $self->call($service, $name, $method, $args);
  +            $show_current_session_object = 0;
           }
  +        my ($type, $name);
           if ($show_current_session_object) {
  -            my $type = $self->so_get("default","ctype","SessionObject");
  -            my $name = $self->so_get("default","cname","default");
  +            $type = $self->so_get("default","ctype","SessionObject");
  +            $name = $self->so_get("default","cname","default");
  +        }
  +        if ($show_current_session_object && $type && $name) {
               $results = $self->service($type, $name);
           }
   
  @@ -1776,6 +1775,7 @@
   =cut
   
   sub send_results {
  +    &App::sub_entry if ($App::trace);
       my ($self, $results) = @_;
   
       my ($serializer, $returntype);
  @@ -1790,14 +1790,16 @@
           my $msg = $self->{messages};
           $self->{messages} = "";
           $msg =~ s/<br>/\n/g;
  -        print $msg;
  +        print $msg, "\n";
       }
       else {
  -        print $results;
  +        print $results, "\n";
       }
  +    &App::sub_exit() if ($App::trace);
   }
   
   sub send_error {
  +    &App::sub_entry if ($App::trace);
       my ($self, $errmsg) = @_;
       print <<EOF;
   -----------------------------------------------------------------------------
  @@ -1810,6 +1812,7 @@
   -----------------------------------------------------------------------------
   $self->{messages}
   EOF
  +    &App::sub_exit() if ($App::trace);
   }
   
   #############################################################################
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.