From bd0aa889095ec92652b11d8f1608e8fdbf5ce6ed Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 1 Mar 2023 21:51:51 +1100 Subject: [PATCH] Fix invalid path references after moving tools & scripts --- tests/python/bl_keymap_completeness.py | 2 +- tools/check_source/check_cmake_consistency_config.py | 2 +- tools/check_source/check_deprecated.py | 2 +- tools/check_source/check_spelling.py | 2 +- tools/check_source/check_unused_defines.py | 2 +- tools/check_wiki/check_wiki_file_structure.py | 3 ++- tools/git/git_sh1_to_svn_rev.py | 2 +- tools/git/git_sort_commits.py | 2 +- tools/utils/autopep8_clean_config.py | 2 +- tools/utils/blender_theme_as_c.py | 4 ++-- tools/utils_api/bpy_introspect_ui.py | 6 +++--- tools/utils_doc/rna_manual_reference_updater.py | 4 ++-- tools/utils_maintenance/c_sort_blocks.py | 2 +- tools/utils_maintenance/c_struct_clean.py | 2 +- tools/utils_maintenance/cmake_sort_filelists.py | 2 +- tools/utils_maintenance/code_clean.py | 2 +- tools/utils_maintenance/trailing_space_clean_config.py | 2 +- 17 files changed, 22 insertions(+), 21 deletions(-) diff --git a/tests/python/bl_keymap_completeness.py b/tests/python/bl_keymap_completeness.py index 1d16cf752a7..7ccafd9e73d 100644 --- a/tests/python/bl_keymap_completeness.py +++ b/tests/python/bl_keymap_completeness.py @@ -5,7 +5,7 @@ # Needed for 'bl_keymap_utils.keymap_hierarchy' which inspects tools. import sys import os -sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, "release", "scripts", "startup")) +sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, "scripts", "startup")) del sys, os from bl_keymap_utils import keymap_hierarchy diff --git a/tools/check_source/check_cmake_consistency_config.py b/tools/check_source/check_cmake_consistency_config.py index 0d92c188252..a9cbc70248b 100644 --- a/tools/check_source/check_cmake_consistency_config.py +++ b/tools/check_source/check_cmake_consistency_config.py @@ -56,7 +56,7 @@ IGNORE_CMAKE = ( UTF8_CHECK = True -SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", ".."))) +SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))) # doesn't have to exist, just use as reference BUILD_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(SOURCE_DIR, "..", "build")))) diff --git a/tools/check_source/check_deprecated.py b/tools/check_source/check_deprecated.py index 31201fa1cb9..4b9e01caac9 100644 --- a/tools/check_source/check_deprecated.py +++ b/tools/check_source/check_deprecated.py @@ -83,7 +83,7 @@ def deprecations() -> List[Tuple[datetime.datetime, Tuple[str, int], str]]: # *DEPRECATED* 2010/12/22 ``some.py.func`` more info. """ - SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", ".."))) + SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))) SKIP_DIRS_ABS = [os.path.join(SOURCE_DIR, p) for p in SKIP_DIRS] diff --git a/tools/check_source/check_spelling.py b/tools/check_source/check_spelling.py index cebb4efff28..73e91a3d6b4 100755 --- a/tools/check_source/check_spelling.py +++ b/tools/check_source/check_spelling.py @@ -64,7 +64,7 @@ from check_spelling_c_config import ( ) BASEDIR = os.path.abspath(os.path.dirname(__file__)) -ROOTDIR = os.path.normpath(os.path.join(BASEDIR, "..", "..", "..")) +ROOTDIR = os.path.normpath(os.path.join(BASEDIR, "..", "..")) # Ensure native slashes. files_ignore = { diff --git a/tools/check_source/check_unused_defines.py b/tools/check_source/check_unused_defines.py index f7a7bed545d..7d7a2922e32 100755 --- a/tools/check_source/check_unused_defines.py +++ b/tools/check_source/check_unused_defines.py @@ -11,7 +11,7 @@ sys.path.append(os.path.join(PWD, "..", "utils_maintenance", "modules")) from batch_edit_text import run -SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(PWD, "..", "..", "..")))) +SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(PWD, "..", "..")))) # TODO, move to config file SOURCE_DIRS = ( diff --git a/tools/check_wiki/check_wiki_file_structure.py b/tools/check_wiki/check_wiki_file_structure.py index 18ed5f76532..8d954d60a2a 100755 --- a/tools/check_wiki/check_wiki_file_structure.py +++ b/tools/check_wiki/check_wiki_file_structure.py @@ -28,7 +28,8 @@ from typing import ( # Constants CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) -SOURCE_DIR = os.path.normpath(os.path.join(CURRENT_DIR, "..", "..", "..")) +SOURCE_DIR = os.path.normpath(os.path.join(CURRENT_DIR, "..", "..")) + WIKI_URL = "https://wiki.blender.org/wiki/Source/File_Structure" WIKI_URL_EDIT = "https://wiki.blender.org/w/index.php?title=Source/File_Structure&action=edit" diff --git a/tools/git/git_sh1_to_svn_rev.py b/tools/git/git_sh1_to_svn_rev.py index 831eb65ba12..f91b729004d 100755 --- a/tools/git/git_sh1_to_svn_rev.py +++ b/tools/git/git_sh1_to_svn_rev.py @@ -5,7 +5,7 @@ import os CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) -SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(CURRENT_DIR, "..", "..", "..")))) +SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(CURRENT_DIR, "..", "..")))) print("creating git-log of %r" % SOURCE_DIR) os.chdir(SOURCE_DIR) diff --git a/tools/git/git_sort_commits.py b/tools/git/git_sort_commits.py index b228d7f851f..e56699f6cfa 100755 --- a/tools/git/git_sort_commits.py +++ b/tools/git/git_sort_commits.py @@ -14,7 +14,7 @@ import sys import os MODULE_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "utils")) -SOURCE_DIR = os.path.normpath(os.path.join(MODULE_DIR, "..", "..", "..", ".git")) +SOURCE_DIR = os.path.normpath(os.path.join(MODULE_DIR, "..", "..", ".git")) sys.path.append(MODULE_DIR) diff --git a/tools/utils/autopep8_clean_config.py b/tools/utils/autopep8_clean_config.py index 5ed0657c06c..fccdc163c4a 100644 --- a/tools/utils/autopep8_clean_config.py +++ b/tools/utils/autopep8_clean_config.py @@ -25,7 +25,7 @@ PATHS: Tuple[str, ...] = ( ) SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath( - os.path.join(os.path.dirname(__file__), "..", "..", "..")))) + os.path.join(os.path.dirname(__file__), "..", "..")))) PATHS = tuple( os.path.join(SOURCE_DIR, p.replace("/", os.sep)) diff --git a/tools/utils/blender_theme_as_c.py b/tools/utils/blender_theme_as_c.py index 6b6b9411d3c..abc1e9ed484 100755 --- a/tools/utils/blender_theme_as_c.py +++ b/tools/utils/blender_theme_as_c.py @@ -68,13 +68,13 @@ del sys source_dst = os.path.join( os.path.dirname(__file__), - "..", "..", "..", + "..", "..", "release", "datafiles", "userdef", "userdef_default_theme.c", ) dna_rename_defs_h = os.path.join( os.path.dirname(__file__), - "..", "..", "..", + "..", "..", "source", "blender", "makesdna", "intern", "dna_rename_defs.h", ) diff --git a/tools/utils_api/bpy_introspect_ui.py b/tools/utils_api/bpy_introspect_ui.py index 555f923998a..2c95a837120 100644 --- a/tools/utils_api/bpy_introspect_ui.py +++ b/tools/utils_api/bpy_introspect_ui.py @@ -441,10 +441,10 @@ def module_classes(mod): def main(): import os - BASE_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..") + BASE_DIR = os.path.join(os.path.dirname(__file__), "..", "..") BASE_DIR = os.path.normpath(os.path.abspath(BASE_DIR)) - MODULE_DIR_UI = os.path.join(BASE_DIR, "release", "scripts", "startup") - MODULE_DIR_MOD = os.path.join(BASE_DIR, "release", "scripts", "modules") + MODULE_DIR_UI = os.path.join(BASE_DIR, "scripts", "startup") + MODULE_DIR_MOD = os.path.join(BASE_DIR, "scripts", "modules") print("Using base dir: %r" % BASE_DIR) print("Using module dir: %r" % MODULE_DIR_UI) diff --git a/tools/utils_doc/rna_manual_reference_updater.py b/tools/utils_doc/rna_manual_reference_updater.py index 3feba7810fd..7c9a7e85fe6 100644 --- a/tools/utils_doc/rna_manual_reference_updater.py +++ b/tools/utils_doc/rna_manual_reference_updater.py @@ -39,7 +39,7 @@ except ImportError: sys.exit(1) # The root of Blender's source directory. -BASE_DIR = os.path.join(os.path.dirname(__file__), "..", "..", "..") +BASE_DIR = os.path.join(os.path.dirname(__file__), "..", "..") # Names that don't match this regex can't be used as URL's. re_name_sanity_match = re.compile("[a-zA-Z0-9._*]+") @@ -131,7 +131,7 @@ def main(): parser.add_argument( "--output", dest="output", - default=os.path.join(BASE_DIR, "release", "scripts", "modules", "rna_manual_reference.py"), + default=os.path.join(BASE_DIR, "scripts", "modules", "rna_manual_reference.py"), required=False, help="path to output including filename and extentsion", metavar="FILE") diff --git a/tools/utils_maintenance/c_sort_blocks.py b/tools/utils_maintenance/c_sort_blocks.py index 600cddbbb4c..f9a3f0620a7 100755 --- a/tools/utils_maintenance/c_sort_blocks.py +++ b/tools/utils_maintenance/c_sort_blocks.py @@ -13,7 +13,7 @@ from typing import ( Optional, ) -SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(PWD, "..", "..", "..")))) +SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(PWD, "..", "..")))) # TODO, move to config file SOURCE_DIRS = ( diff --git a/tools/utils_maintenance/c_struct_clean.py b/tools/utils_maintenance/c_struct_clean.py index 2c0f038d140..2da4e831c84 100755 --- a/tools/utils_maintenance/c_struct_clean.py +++ b/tools/utils_maintenance/c_struct_clean.py @@ -23,7 +23,7 @@ sys.path.append(os.path.join(PWD, "modules")) from batch_edit_text import run -SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(PWD, "..", "..", "..")))) +SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(PWD, "..", "..")))) # TODO: move to configuration file. SOURCE_DIRS = ( diff --git a/tools/utils_maintenance/cmake_sort_filelists.py b/tools/utils_maintenance/cmake_sort_filelists.py index bc74d6d2717..c2cecec428a 100755 --- a/tools/utils_maintenance/cmake_sort_filelists.py +++ b/tools/utils_maintenance/cmake_sort_filelists.py @@ -19,7 +19,7 @@ sys.path.append(os.path.join(PWD, "modules")) from batch_edit_text import run -SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(PWD, "..", "..", "..")))) +SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(PWD, "..", "..")))) # TODO, move to config file SOURCE_DIRS = ( diff --git a/tools/utils_maintenance/code_clean.py b/tools/utils_maintenance/code_clean.py index 62b15481510..6a37ac4d82d 100755 --- a/tools/utils_maintenance/code_clean.py +++ b/tools/utils_maintenance/code_clean.py @@ -48,7 +48,7 @@ VERBOSE_EDIT_ACTION = False BASE_DIR = os.path.abspath(os.path.dirname(__file__)) -SOURCE_DIR = os.path.normpath(os.path.join(BASE_DIR, "..", "..", "..")) +SOURCE_DIR = os.path.normpath(os.path.join(BASE_DIR, "..", "..")) # ----------------------------------------------------------------------------- diff --git a/tools/utils_maintenance/trailing_space_clean_config.py b/tools/utils_maintenance/trailing_space_clean_config.py index f768ed53c17..a1ad44a5c86 100644 --- a/tools/utils_maintenance/trailing_space_clean_config.py +++ b/tools/utils_maintenance/trailing_space_clean_config.py @@ -22,7 +22,7 @@ PATHS = ( SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath( - os.path.join(os.path.dirname(__file__), "..", "..", "..")))) + os.path.join(os.path.dirname(__file__), "..", "..")))) PATHS = tuple( os.path.join(SOURCE_DIR, p.replace("/", os.sep))