[gimp-perl] $Gimp::verbose == 1 only give PDB calls.



commit 500a40f121c8d362952f00a149c232f75f3a4f4d
Author: Ed J <edj src gnome org>
Date:   Mon Jun 23 05:53:24 2014 +0100

    $Gimp::verbose == 1 only give PDB calls.

 Gimp.pm           |    6 +++---
 Gimp/Extension.pm |    2 +-
 Gimp/Fu.pm        |    4 ++--
 Gimp/Lib.pm       |    2 +-
 Gimp/Pod.pm       |    2 +-
 Net/Net.pm        |   24 ++++++++++++------------
 UI/UI.pm          |   10 +++++-----
 7 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/Gimp.pm b/Gimp.pm
index 18164e5..1365382 100644
--- a/Gimp.pm
+++ b/Gimp.pm
@@ -223,7 +223,7 @@ if ($interface_type=~/^lib$/i) {
 } else {
    croak __"interface '$interface_type' unsupported.";
 }
-warn "$$-Using interface '$interface_type'" if $Gimp::verbose;
+warn "$$-Using interface '$interface_type'" if $Gimp::verbose >= 2;
 
 eval "require $interface_pkg" or croak $@;
 $interface_pkg->import;
@@ -246,7 +246,7 @@ my %ignore_function = (DESTROY => 1);
 @PREFIXES=("gimp_", "");
 
 sub ignore_functions(@) {
-   warn "$$-IGNORING(@_)" if $Gimp::verbose;
+   warn "$$-IGNORING(@_)" if $Gimp::verbose >= 2;
    @ignore_function{ _}++;
 }
 
@@ -309,7 +309,7 @@ sub AUTOLOAD {
        warn "$$-gimp_call_procedure{0}(@_)" if $Gimp::verbose >= 2;
        shift unless ref $_[0];
        unshift @_, $sub;
-       warn "$$-gimp_call_procedure{1}(@_)" if $Gimp::verbose;
+       warn "$$-gimp_call_procedure{1}(@_)" if $Gimp::verbose >= 2;
        my @r = eval { gimp_call_procedure (@_) };
        recroak exception_strip(__FILE__, $@) if $@; wantarray ? @r : $r[0];
       };
diff --git a/Gimp/Extension.pm b/Gimp/Extension.pm
index e8a7e90..03dfd5d 100644
--- a/Gimp/Extension.pm
+++ b/Gimp/Extension.pm
@@ -34,7 +34,7 @@ Gimp::on_query {
 sub podregister (&) {
    my @procinfo = fixup_args(('')x9, @_);
    Gimp::register_callback $procinfo[0] => sub {
-      warn "$$-Gimp::Extension sub: $procinfo[0](@_)" if $Gimp::verbose;
+      warn "$$-Gimp::Extension sub: $procinfo[0](@_)" if $Gimp::verbose >= 2;
       for my $tp (@temp_procs) {
         my @tpinfo = (
            @{$tp}[0..2],
diff --git a/Gimp/Fu.pm b/Gimp/Fu.pm
index ea6b70a..be501bc 100644
--- a/Gimp/Fu.pm
+++ b/Gimp/Fu.pm
@@ -209,7 +209,7 @@ Gimp::on_net {
         ("$_=s"=>sub {$args[$mangleparam2index{$_[0]}] = $_[1]; $interact--;})
       } keys %mangleparam2index,
    );
-   warn "$$-".__PACKAGE__." on_net (@args) (@ARGV) '$interact'" if $Gimp::verbose;
+   warn "$$-".__PACKAGE__." on_net (@args) (@ARGV) '$interact'" if $Gimp::verbose >= 2;
    die "$0: too many arguments. Try $0 --help\n" if @ARGV > @$params;
    $interact -= @ARGV;
    map { $args[$_] = $ARGV[$_] } (0..$#ARGV); # can mix & match --args and bare
@@ -383,7 +383,7 @@ sub register($$$$$$$$$;@) {
 
 sub save_image($$) {
    my($img,$path)= _;
-   warn "saving image $path\n" if $Gimp::verbose;
+   warn "saving image $path\n" if $Gimp::verbose >= 2;
    my $flatten=0;
    my $interlace=0;
    my $quality=0.75;
diff --git a/Gimp/Lib.pm b/Gimp/Lib.pm
index 931b044..7226ca3 100644
--- a/Gimp/Lib.pm
+++ b/Gimp/Lib.pm
@@ -8,7 +8,7 @@ BEGIN {
    $VERSION = "2.30_05";
    require XSLoader;
    XSLoader::load Gimp::Lib $VERSION;
-   warn "$$-Loading ".__PACKAGE__ if $Gimp::verbose;
+   warn "$$-Loading ".__PACKAGE__ if $Gimp::verbose >= 2;
 }
 
 sub gimp_init {
diff --git a/Gimp/Pod.pm b/Gimp/Pod.pm
index 2e6797c..0f80a40 100644
--- a/Gimp/Pod.pm
+++ b/Gimp/Pod.pm
@@ -12,7 +12,7 @@ use Pod::Simple::SimpleTree;
 our @EXPORT = qw(fixup_args make_arg_line);
 our $VERSION = "2.30_05";
 
-warn "$$-Loading ".__PACKAGE__ if $Gimp::verbose;
+warn "$$-Loading ".__PACKAGE__ if $Gimp::verbose >= 2;
 
 sub __ ($) { goto &Gimp::__ }
 
diff --git a/Net/Net.pm b/Net/Net.pm
index f3a2ba4..fa605f7 100644
--- a/Net/Net.pm
+++ b/Net/Net.pm
@@ -22,7 +22,7 @@ package Gimp::Net;
 # Aelem1\0elem2...
 # Rclass\0scalar-value
 
-BEGIN { warn "$$-Loading ".__PACKAGE__ if $Gimp::verbose; }
+BEGIN { warn "$$-Loading ".__PACKAGE__ if $Gimp::verbose >= 2; }
 
 use strict;
 use warnings;
@@ -67,7 +67,7 @@ sub command {
 
 sub import {
    my $pkg = shift;
-   warn "$$-$pkg->import(@_)" if $Gimp::verbose;
+   warn "$$-$pkg->import(@_)" if $Gimp::verbose >= 2;
    return if @_;
    # overwrite some destroy functions
    *Gimp::Tile::DESTROY=
@@ -79,7 +79,7 @@ sub import {
 }
 
 sub gimp_call_procedure {
-   warn "$$-Net::gimp_call_procedure(@_)" if $Gimp::verbose;
+   warn "$$-Net::gimp_call_procedure(@_)" if $Gimp::verbose >= 2;
    my @response = command("EXEC", $Gimp::verbose, @_);
    my $die_text = shift @response;
    Gimp::recroak(Gimp::exception_strip(__FILE__, $die_text)) if $die_text;
@@ -100,7 +100,7 @@ my $PROC_SF = 'extension-perl-server';
 sub start_server {
    my $opt = shift;
    $opt = $Gimp::spawn_opts unless $opt;
-   warn __"$$-start_server($opt)" if $Gimp::verbose;
+   warn __"$$-start_server($opt)" if $Gimp::verbose >= 2;
    croak __"unable to create socketpair for gimp communications: $!"
       unless ($server_fh, my $gimp_fh) =
         IO::Socket->socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC);
@@ -123,11 +123,11 @@ sub start_server {
    my @exec_args = ($Gimp::Config{GIMP}, qw(--no-splash --console-messages));
    push @exec_args, "--no-data" if $opt=~s/(^|:)no-?data//;
    push @exec_args, "-i" unless $opt=~s/(^|:)gui//;
-   push @exec_args, "--verbose" if $Gimp::verbose;
+   push @exec_args, "--verbose" if $Gimp::verbose >= 2;
    push @exec_args, qw(--pdb-compat-mode off);
    push @exec_args, qw(--batch-interpreter plug-in-script-fu-eval -b);
    push @exec_args, "(if (defined? '$PROC_SF) ($PROC_SF $args)) (gimp-quit 0)";
-   warn __"$$-exec @exec_args\n" if $Gimp::verbose;
+   warn __"$$-exec @exec_args\n" if $Gimp::verbose >= 2;
    { exec @exec_args; } # block to suppress warning
    croak __"unable to exec: $!";
 }
@@ -160,7 +160,7 @@ sub try_connect {
 }
 
 sub gimp_init {
-   warn "$$-gimp_init(@_)" if $Gimp::verbose;
+   warn "$$-gimp_init(@_)" if $Gimp::verbose >= 2;
    if (@_) {
       $server_fh = try_connect ($_[0]);
    } elsif (defined($Gimp::host)) {
@@ -193,7 +193,7 @@ sub gimp_init {
 }
 
 sub gimp_end {
-   warn "$$-gimp_end - gimp_pid=$gimp_pid" if $Gimp::verbose;
+   warn "$$-gimp_end - gimp_pid=$gimp_pid" if $Gimp::verbose >= 2;
    $initialized = 0;
    if ($gimp_pid and $server_fh) {
       server_quit;
@@ -313,7 +313,7 @@ sub handle_request($) {
 }
 
 sub on_accept {
-  warn "$$-on_accept(@_)" if $Gimp::verbose;
+  warn "$$-on_accept(@_)" if $Gimp::verbose >= 2;
   my $h = shift;
   slog sprintf __"new connection(%d)%s",
     $h->fileno,
@@ -334,7 +334,7 @@ sub on_input {
 }
 
 sub setup_listen_unix {
-  warn "$$-setup_listen_unix(@_)" if $Gimp::verbose;
+  warn "$$-setup_listen_unix(@_)" if $Gimp::verbose >= 2;
   use autodie;
   use File::Basename;
   my $host = shift;
@@ -348,7 +348,7 @@ sub setup_listen_unix {
 }
 
 sub setup_listen_tcp {
-  warn "$$-setup_listen_tcp(@_)" if $Gimp::verbose;
+  warn "$$-setup_listen_tcp(@_)" if $Gimp::verbose >= 2;
   use autodie;
   my $host = shift;
   ($host, my $port)=split /:/,$host;
@@ -362,7 +362,7 @@ sub setup_listen_tcp {
 
 sub perl_server_run {
   (my $filehandle, $Gimp::verbose) = @_;
-  warn "$$-".__PACKAGE__."::perl_server_run(@_)\n" if $Gimp::verbose;
+  warn "$$-".__PACKAGE__."::perl_server_run(@_)\n" if $Gimp::verbose >= 2;
   if ($Gimp::Fu::run_mode == &Gimp::RUN_NONINTERACTIVE) {
       die __"unable to open Gimp::Net communications socket: $!\n"
         unless open my $fh,"+<&$filehandle";
diff --git a/UI/UI.pm b/UI/UI.pm
index d472e8f..66fbf4f 100644
--- a/UI/UI.pm
+++ b/UI/UI.pm
@@ -90,7 +90,7 @@ sub get_active_scalar {
 }
 
 sub reload {
-  warn __PACKAGE__ . "::reload(@_)" if $Gimp::verbose;
+  warn __PACKAGE__ . "::reload(@_)" if $Gimp::verbose >= 2;
   my ($self) = @_;
   my $count = keys %{ $self->{GIMPUI_text2scalar} };
   $self->remove_text(0) while $count--;
@@ -339,7 +339,7 @@ sub help_window(\$$$$) {
 }
 
 sub _instrument {
-  return unless $Gimp::verbose;
+  return unless $Gimp::verbose >= 2;
   my $obj = shift;
   my $class = ref $obj;
   my %sig2done;
@@ -619,8 +619,8 @@ my %PF2INFO = (
   },
 );
 
-sub interact($$$$@) {
-  warn __PACKAGE__ . "::interact(@_)" if $Gimp::verbose;
+sub interact {
+  warn __PACKAGE__ . "::interact(@_)" if $Gimp::verbose >= 2;
   my ($function, $blurb, $help, $params, $menupath) = splice @_, 0, 5;
   my (@getvals, @setvals, @lastvals, @defaults);
   my $helpwin;
@@ -655,7 +655,7 @@ sub interact($$$$@) {
     $value=$default unless defined $value;
     die sprintf __"Unsupported argumenttype %s for %s\n", $type, $name
       unless $PF2INFO{$type};
-    my ($a, $sv, $gv) = $PF2INFO{$type}->( $name,$desc,$default,$extra,$value);
+    my ($a, $sv, $gv) = $PF2INFO{$type}->($name,$desc,$default,$extra,$value);
     push @setvals, $sv;
     push @getvals, $gv;
     push @lastvals, $value;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]