Cleanup: declare __all__ for many scripts in tools/

This commit is contained in:
Campbell Barton
2025-01-04 20:27:07 +11:00
parent 6f64d70e60
commit 5fe261c89d
61 changed files with 290 additions and 13 deletions

View File

@@ -16,6 +16,9 @@ Piping from the standard-input is also supported:
The text is printed to the standard output.
"""
__all__ = (
"main",
)
import argparse
import multiprocessing

View File

@@ -13,6 +13,10 @@ Example use a custom range:
authors_git_gen.py --source=/src/blender --range=SHA1..HEAD
"""
__all__ = (
"main",
)
# NOTE: this shares the basic structure with `credits_git_gen.py`,
# however details differ enough for them to be separate scripts.
# Improvements to this script may apply there too.

View File

@@ -3,6 +3,11 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
__all__ = (
"main",
)
import subprocess
import os
from os.path import join

View File

@@ -2,6 +2,12 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
__all__ = (
"PATHS",
"PATHS_EXCLUDE",
"SOURCE_DIR",
)
import os
from collections.abc import (

View File

@@ -32,6 +32,10 @@ To check a .blend file instead of outputting its JSon version (use explicit -o o
./blend2json.py -c foo.blend
"""
__all__ = (
"main",
)
FILTER_DOC = """
Each generic filter is made of three arguments, the include/exclude toggle ('+'/'-'), a regex to match against the name

View File

@@ -28,6 +28,9 @@ config = [
("rmb_action", ('TWEAK', 'FALLBACK_TOOL')),
]
"""
__all__ = (
"main",
)
import os
import sys

View File

@@ -3,6 +3,10 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
__all__ = (
"main",
)
import os
import subprocess
import sys

View File

@@ -16,6 +16,10 @@ eg:
./tools/utils/blender_theme_as_c.py $(find ~/.config/blender -name "userpref.blend" | sort | tail -1)
"""
__all__ = (
"main",
)
C_SOURCE_HEADER = r'''/* SPDX-FileCopyrightText: 2018 Blender Authors
*

View File

@@ -12,6 +12,10 @@ Example use a custom range:
credits_git_gen.py --source=/src/blender --range=SHA1..HEAD
"""
__all__ = (
"main",
)
# NOTE: this shares the basic structure with `credits_git_gen.py`,
# however details differ enough for them to be separate scripts.

View File

@@ -3,6 +3,10 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
__all__ = (
"main",
)
import argparse
import re
import shutil

View File

@@ -11,6 +11,11 @@ Example use:
(gdb) source tools/utils/gdb_struct_repr_c99.py
(gdb) print_struct_c99 scene->toolsettings
'''
__all__ = (
"main",
)
import sys
class PrintStructC99(gdb.Command):
@@ -46,10 +51,16 @@ class PrintStructC99(gdb.Command):
print(' ' * hs + '.' + rr_s[0] + '= ' + rr_rval)
print('Running GDB from: {:s}\n'.format(gdb.PYTHONDIR))
gdb.execute("set print pretty")
gdb.execute('set pagination off')
gdb.execute('set print repeats 0')
gdb.execute('set print elements unlimited')
# instantiate
PrintStructC99()
def main() -> int:
print('Running GDB from: {:s}\n'.format(gdb.PYTHONDIR))
gdb.execute("set print pretty")
gdb.execute('set pagination off')
gdb.execute('set print repeats 0')
gdb.execute('set print elements unlimited')
# instantiate
PrintStructC99()
return 0
if __name__ == "__main__":
sys.exit(main())

View File

@@ -4,6 +4,13 @@
# Simple module for inspecting git commits
__all__ = (
"GitCommit",
"GitCommitIter",
"GitRepo",
)
import os
import subprocess
import datetime

View File

@@ -12,6 +12,9 @@ Example usage:
./git_log_review_commits.py --source=../../.. --range=HEAD~40..HEAD --filter=BUGFIX
"""
__all__ = (
"main",
)
class _Getch:

View File

@@ -29,6 +29,10 @@ To exclude all commits from some given files, by sha1 or by commit message (from
"""
__all__ = (
"main",
)
import os
import sys
import io

View File

@@ -11,6 +11,10 @@
# * 403 Client Error: That means the token doesn't have the right scope.
# * 500 Server Error: The token is invalid.
__all__ = (
"main",
)
import logging
import os
import requests

View File

@@ -6,6 +6,10 @@
# Created by Robert Wenzlaff (Det. Thorn).
# Oct. 30, 2003
__all__ = (
"main",
)
import sys
from tkinter import (
Button,

View File

@@ -4,6 +4,9 @@
# Converts 32x32 XPM images written be the gimp to GL stipples
# takes XPM files as arguments, prints out C style definitions.
__all__ = (
"main",
)
import sys
import os

View File

@@ -17,6 +17,10 @@ Example Use::
blender.bin -b --factory-startup my_shapes.blend --python make_shape_2d_from_blend.py
'''
__all__ = (
"main",
)
import bpy
import os