Commit bad831ce authored by Manish Singh's avatar Manish Singh Committed by Manish Singh

use True and False if available. Ditch GIMP_ prefixes since we have real

2003-02-08  Manish Singh  <yosh@gimp.org>

        * tools/pdbgen/enumcode-py.pl: use True and False if available.
        Ditch GIMP_ prefixes since we have real namespaces in python.

        * tools/pdbgen/Makefile.am: generate python enums too

        * tools/pdbgen/enumcode.pl: cosmetic cleanup
parent f8861444
2003-02-08 Manish Singh <yosh@gimp.org>
* tools/pdbgen/enumcode-py.pl: use True and False if available.
Ditch GIMP_ prefixes since we have real namespaces in python.
* tools/pdbgen/Makefile.am: generate python enums too
* tools/pdbgen/enumcode.pl: cosmetic cleanup
2003-02-08 Sven Neumann <sven@gimp.org>
* libgimp/gimpmiscui.c (gimp_fixme_preview_fill): fixed
......
......@@ -4,3 +4,4 @@ stamp-enums
stamp-groups
stamp-pdbgen
stamp-enum-code
stamp-enum-code-py
......@@ -110,4 +110,12 @@ stamp-enum-code: $(srcdir)/enumcode.pl enums.pl util.pl
$(PERL) enumcode.pl \
&& echo timestamp > $$rootme/stamp-enum-code
all-local: stamp-pdbgen stamp-enum-code
stamp-enum-code-py: $(srcdir)/enumcode-py.pl enums.pl util.pl
rootme=`pwd`; \
destdir=`cd $(top_srcdir) && pwd`; export destdir; \
cd $(srcdir) && \
PDBGEN_BACKUP=$(PDBGEN_BACKUP) \
$(PERL) enumcode-py.pl \
&& echo timestamp > $$rootme/stamp-enum-code-py
all-local: stamp-pdbgen stamp-enum-code stamp-enum-code-py
......@@ -67,8 +67,15 @@ print ENUMFILE <<'GPL';
GPL
print ENUMFILE <<'CODE';
TRUE = 1
FALSE = 0
# TRUE and FALSE constants ...
import __builtin__
if not hasattr(__builtin__, 'True'):
__builtin__.True = (1 == 1)
__builtin__.False = (1 != 1)
del __builtin__
FALSE = False
TRUE = True
CODE
foreach (sort keys %enums) {
......@@ -80,6 +87,7 @@ foreach (sort keys %enums) {
my $sym = $symbol;
# Maybe Python has nice enough namespace handling that we don't
# need to prefix all constants with GIMP_
$sym =~ s/^GIMP\_//;
$body .= "$sym";
if (!$enum->{contig}) {
$i = $enum->{mapping}->{$symbol};
......
......@@ -124,6 +124,7 @@ HEADER
foreach (sort keys %enums) {
if (! ($enums{$_}->{header} =~ /libgimp/)) {
print ENUMFILE "typedef enum\n{\n";
my $enum = $enums{$_}; my $body = "";
foreach $symbol (@{$enum->{symbols}}) {
my $sym = $symbol;
......@@ -153,5 +154,3 @@ HEADER
close ENUMFILE;
&write_file($enumfile);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment