Skip to content

Commit 47a4bff

Browse files
authored
Minor fixes and improvements (#524)
* Ensure `pyvips.shutdown()` is public * Move `pyvips.shutdown()` to `base.py` * Reformat * De-duplicate `__all__` in `__init__.py` with other modules * Fix typo
1 parent 8ed689e commit 47a4bff

File tree

6 files changed

+23
-21
lines changed

6 files changed

+23
-21
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ with:
7979
8080
This installs a self-contained package with the most commonly needed
8181
libraries. It should just work on most common platforms, including Linux,
82-
Window and macOS, with x64 and ARM CPUs.
82+
Windows and macOS, with x64 and ARM CPUs.
8383

8484
If your platform is unsupported or the pre-built binary is
8585
unsuitable, you can install libvips separately instead.

pyvips/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,4 @@ def _remove_log_handler():
196196
from .vimage import *
197197
from .vregion import *
198198

199-
__all__ = [
200-
'Error', 'Image', 'Region', 'Introspect', 'Operation', 'GValue', 'Interpolate', 'GObject',
201-
'VipsObject', 'type_find', 'type_name', 'version', '__version__',
202-
'at_least_libvips', 'API_mode',
203-
'get_suffixes',
204-
'cache_set_max', 'cache_set_max_mem', 'cache_set_max_files',
205-
]
199+
__all__ = ['API_mode']

pyvips/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ def leak_set(leak):
1515
return vips_lib.vips_leak_set(leak)
1616

1717

18+
def shutdown():
19+
"""Shut libvips down."""
20+
vips_lib.vips_shutdown()
21+
22+
1823
def version(flag):
1924
"""Get the major, minor or micro version number of the libvips library.
2025
@@ -152,6 +157,7 @@ def flags_dict(gtype):
152157

153158
__all__ = [
154159
'leak_set',
160+
'shutdown',
155161
'version',
156162
'at_least_libvips',
157163
'type_find',

pyvips/error.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,8 @@ def __str__(self):
7272

7373

7474
__all__ = [
75-
'_to_bytes', '_to_string', '_to_string_copy', 'Error',
75+
'_to_bytes',
76+
'_to_string',
77+
'_to_string_copy',
78+
'Error'
7679
]

pyvips/vdecls.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,4 @@ def cdefs(features):
480480
return code
481481

482482

483-
__all__ = [
484-
'cdefs'
485-
]
483+
__all__ = ['cdefs']

pyvips/voperation.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,6 @@ def add_name(gtype, a, b):
540540
print(' ' + docstr)
541541

542542

543-
def shutdown():
544-
"""Shut libvips down."""
545-
vips_lib.vips_shutdown()
546-
547-
548543
def cache_set_max(mx):
549544
"""Set the maximum number of operations libvips will cache."""
550545
vips_lib.vips_cache_set_max(mx)
@@ -598,10 +593,16 @@ def operation_block_set(name, state):
598593

599594

600595
__all__ = [
601-
'Introspect', 'Operation',
602-
'cache_set_max', 'cache_set_max_mem', 'cache_set_max_files',
596+
'Introspect',
597+
'Operation',
598+
'cache_set_max',
599+
'cache_set_max_mem',
600+
'cache_set_max_files',
603601
'cache_set_trace',
604-
'cache_get_max', 'cache_get_max_mem', 'cache_get_max_files',
602+
'cache_get_max',
603+
'cache_get_max_mem',
604+
'cache_get_max_files',
605605
'cache_get_size',
606-
'block_untrusted_set', 'operation_block_set',
606+
'block_untrusted_set',
607+
'operation_block_set'
607608
]

0 commit comments

Comments
 (0)