Skip to content

Commit eac00ac

Browse files
committed
Avoid generating redundant enums
1 parent b6fe7ec commit eac00ac

File tree

3 files changed

+1
-43
lines changed

3 files changed

+1
-43
lines changed

examples/gen-enums.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import xml.etree.ElementTree as ET
55

66
from pyvips import ffi, enum_dict, flags_dict, \
7-
vips_lib, type_map, type_name, type_from_name
7+
type_map, type_name, type_from_name
88

99
# This file generates enums.py -- the set of classes giving the permissible
1010
# values for the pyvips enums/flags. Run with something like:
@@ -103,10 +103,6 @@ def add_nickname(gtype, a, b):
103103

104104
type_map(type_from_name('GEnum'), add_nickname)
105105

106-
# Filter internal enums
107-
blacklist = ['VipsImageType', 'VipsToken']
108-
all_nicknames = [name for name in all_nicknames if name not in blacklist]
109-
110106
for name in all_nicknames:
111107
gtype = type_from_name(name)
112108
python_name = remove_prefix(name)
@@ -198,11 +194,6 @@ def add_nickname(gtype, a, b):
198194

199195

200196
if __name__ == "__main__":
201-
# otherwise we're missing some enums
202-
vips_lib.vips_token_get_type()
203-
vips_lib.vips_saveable_get_type()
204-
vips_lib.vips_image_type_get_type()
205-
206197
print('# libvips enums -- this file is generated automatically')
207198
print('# flake8: noqa: E501') # ignore line too long error
208199
generate_enums()

pyvips/enums.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,33 +1425,3 @@ class ForeignPngFilter(object):
14251425
AVG = 64
14261426
PAETH = 128
14271427
ALL = 248
1428-
1429-
1430-
class ForeignSaveable(object):
1431-
"""ForeignSaveable.
1432-
1433-
The set of image types supported by a saver.
1434-
1435-
::: seealso
1436-
:class:`.ForeignSave`.
1437-
1438-
Attributes:
1439-
1440-
ANY (int): saver supports everything (eg. TIFF)
1441-
1442-
MONO (int): 1 band
1443-
1444-
RGB (int): 3 bands
1445-
1446-
CMYK (int): 4 bands
1447-
1448-
ALPHA (int): an extra band
1449-
1450-
"""
1451-
1452-
ANY = 0
1453-
MONO = 1
1454-
RGB = 2
1455-
CMYK = 4
1456-
ALPHA = 8
1457-
ALL = 15

pyvips/vdecls.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ def cdefs(features):
135135
GType vips_interpretation_get_type (void);
136136
GType vips_operation_flags_get_type (void);
137137
GType vips_band_format_get_type (void);
138-
GType vips_token_get_type (void);
139-
GType vips_saveable_get_type (void);
140-
GType vips_image_type_get_type (void);
141138
142139
typedef ... GData;
143140

0 commit comments

Comments
 (0)