[gimp-perl] Make fixup_args also add "perl_fu_" etc.
- From: Ed J <edj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp-perl] Make fixup_args also add "perl_fu_" etc.
- Date: Wed, 21 May 2014 01:05:29 +0000 (UTC)
commit 3dc92383d796171deb083928a081d46553ff5fc8
Author: Ed J <edj src gnome org>
Date: Wed May 21 02:05:12 2014 +0100
Make fixup_args also add "perl_fu_" etc.
Gimp/Fu.pm | 5 -----
Gimp/Pod.pm | 4 ++++
2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/Gimp/Fu.pm b/Gimp/Fu.pm
index d2a831f..27d36e8 100644
--- a/Gimp/Fu.pm
+++ b/Gimp/Fu.pm
@@ -283,11 +283,6 @@ sub register($$$$$$$$$;@) {
my ($function, $blurb, $help, $author, $copyright, $date, $menupath,
$imagetypes, $params, $results, $code) = fixup_args(@_);
- $function="perl_fu_".$function unless $function =~ /^(?:perl_fu_|extension_|plug_in_|file_)/ || $function
=~ s/^\+//;
- $function=~/^[0-9a-z_]+(-ALT)?$/ or carp(__"$function: function name contains unusual characters, good
style is to use only 0-9, a-z and _");
- carp __"function name contains dashes instead of underscores\n"
- if $function =~ y/-//;
-
Gimp::register_callback $function => sub {
$run_mode = defined($menupath) ? shift : undef; # global!
my(@pre,@defaults,@lastvals);
diff --git a/Gimp/Pod.pm b/Gimp/Pod.pm
index 226d52a..a47e714 100644
--- a/Gimp/Pod.pm
+++ b/Gimp/Pod.pm
@@ -143,6 +143,10 @@ sub fixup_args {
carp __"$p[0]: argument name '$val->[1]' contains illegal characters, only 0-9, a-z and _ allowed"
unless $val->[1]=~/^[0-9a-z_]+$/;
}
+ $p[0]="perl_fu_".$p[0] unless $p[0] =~ /^(?:perl_fu_|extension_|plug_in_|file_)/ || $p[0] =~ s/^\+//;
+ $p[0]=~/^[0-9a-z_]+(-ALT)?$/ or carp(__"$p[0]: function name contains unusual characters, good style is
to use only 0-9, a-z and _");
+ carp __"function name contains dashes instead of underscores\n"
+ if $p[0] =~ y/-//;
insert_params(@p);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]