Cleanup: declare __all__ for Python scripts
Declare all to make public public API's explicit and help detect unused code.
This commit is contained in:
@@ -2,16 +2,19 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
"""
|
||||
blender -b --factory-startup --python tests/python/bl_animation_drivers.py -- --testdir /path/to/tests/data/animation
|
||||
"""
|
||||
__all__ = (
|
||||
"main",
|
||||
)
|
||||
|
||||
import unittest
|
||||
import bpy
|
||||
import pathlib
|
||||
import sys
|
||||
from rna_prop_ui import rna_idprop_quote_path
|
||||
|
||||
"""
|
||||
blender -b --factory-startup --python tests/python/bl_animation_drivers.py -- --testdir /path/to/tests/data/animation
|
||||
"""
|
||||
|
||||
|
||||
class AbstractEmptyDriverTest:
|
||||
def setUp(self):
|
||||
|
||||
@@ -2,7 +2,13 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# ./blender.bin --background --python tests/python/bl_blendfile_liblink.py
|
||||
"""
|
||||
./blender.bin --background --python tests/python/bl_blendfile_liblink.py
|
||||
"""
|
||||
__all__ = (
|
||||
"main",
|
||||
)
|
||||
|
||||
import bpy
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
#
|
||||
# This needs to be investigated!
|
||||
|
||||
__all__ = (
|
||||
"main",
|
||||
)
|
||||
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
__all__ = (
|
||||
"main",
|
||||
)
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
__all__ = (
|
||||
"main",
|
||||
)
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
"""
|
||||
./blender.bin --background --factory-startup --python tests/python/bl_load_addons.py
|
||||
"""
|
||||
__all__ = (
|
||||
"main",
|
||||
)
|
||||
|
||||
import bpy
|
||||
import addon_utils
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
# Simple script to check mash validate code.
|
||||
# XXX Should be extended with many more "wrong cases"!
|
||||
|
||||
__all__ = (
|
||||
"main",
|
||||
)
|
||||
|
||||
import bpy
|
||||
|
||||
import random
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# ./blender.bin --background --python tests/python/bl_pyapi_bpy_utils_units.py -- --verbose
|
||||
|
||||
__all__ = (
|
||||
"main",
|
||||
)
|
||||
|
||||
import unittest
|
||||
|
||||
from bpy.utils import units
|
||||
@@ -93,7 +98,11 @@ class UnitsTesting(unittest.TestCase):
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
def main():
|
||||
import sys
|
||||
sys.argv = [__file__] + (sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else [])
|
||||
unittest.main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
__all__ = (
|
||||
"AbstractImBufTest",
|
||||
)
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
import shutil
|
||||
|
||||
Reference in New Issue
Block a user