Fix invalid path references after moving tools & scripts

This commit is contained in:
Campbell Barton 2023-03-01 21:51:51 +11:00
parent 1ed783eed3
commit bd0aa88909
17 changed files with 22 additions and 21 deletions

@ -5,7 +5,7 @@
# Needed for 'bl_keymap_utils.keymap_hierarchy' which inspects tools. # Needed for 'bl_keymap_utils.keymap_hierarchy' which inspects tools.
import sys import sys
import os 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 del sys, os
from bl_keymap_utils import keymap_hierarchy from bl_keymap_utils import keymap_hierarchy

@ -56,7 +56,7 @@ IGNORE_CMAKE = (
UTF8_CHECK = True 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 # 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")))) BUILD_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(SOURCE_DIR, "..", "build"))))

@ -83,7 +83,7 @@ def deprecations() -> List[Tuple[datetime.datetime, Tuple[str, int], str]]:
# *DEPRECATED* 2010/12/22 ``some.py.func`` more info. # *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] SKIP_DIRS_ABS = [os.path.join(SOURCE_DIR, p) for p in SKIP_DIRS]

@ -64,7 +64,7 @@ from check_spelling_c_config import (
) )
BASEDIR = os.path.abspath(os.path.dirname(__file__)) 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. # Ensure native slashes.
files_ignore = { files_ignore = {

@ -11,7 +11,7 @@ sys.path.append(os.path.join(PWD, "..", "utils_maintenance", "modules"))
from batch_edit_text import run 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 # TODO, move to config file
SOURCE_DIRS = ( SOURCE_DIRS = (

@ -28,7 +28,8 @@ from typing import (
# Constants # Constants
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) 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 = "https://wiki.blender.org/wiki/Source/File_Structure"
WIKI_URL_EDIT = "https://wiki.blender.org/w/index.php?title=Source/File_Structure&action=edit" WIKI_URL_EDIT = "https://wiki.blender.org/w/index.php?title=Source/File_Structure&action=edit"

@ -5,7 +5,7 @@
import os import os
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) 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) print("creating git-log of %r" % SOURCE_DIR)
os.chdir(SOURCE_DIR) os.chdir(SOURCE_DIR)

@ -14,7 +14,7 @@ import sys
import os import os
MODULE_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "utils")) 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) sys.path.append(MODULE_DIR)

@ -25,7 +25,7 @@ PATHS: Tuple[str, ...] = (
) )
SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath( 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( PATHS = tuple(
os.path.join(SOURCE_DIR, p.replace("/", os.sep)) os.path.join(SOURCE_DIR, p.replace("/", os.sep))

@ -68,13 +68,13 @@ del sys
source_dst = os.path.join( source_dst = os.path.join(
os.path.dirname(__file__), os.path.dirname(__file__),
"..", "..", "..", "..", "..",
"release", "datafiles", "userdef", "userdef_default_theme.c", "release", "datafiles", "userdef", "userdef_default_theme.c",
) )
dna_rename_defs_h = os.path.join( dna_rename_defs_h = os.path.join(
os.path.dirname(__file__), os.path.dirname(__file__),
"..", "..", "..", "..", "..",
"source", "blender", "makesdna", "intern", "dna_rename_defs.h", "source", "blender", "makesdna", "intern", "dna_rename_defs.h",
) )

@ -441,10 +441,10 @@ def module_classes(mod):
def main(): def main():
import os 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)) BASE_DIR = os.path.normpath(os.path.abspath(BASE_DIR))
MODULE_DIR_UI = os.path.join(BASE_DIR, "release", "scripts", "startup") MODULE_DIR_UI = os.path.join(BASE_DIR, "scripts", "startup")
MODULE_DIR_MOD = os.path.join(BASE_DIR, "release", "scripts", "modules") MODULE_DIR_MOD = os.path.join(BASE_DIR, "scripts", "modules")
print("Using base dir: %r" % BASE_DIR) print("Using base dir: %r" % BASE_DIR)
print("Using module dir: %r" % MODULE_DIR_UI) print("Using module dir: %r" % MODULE_DIR_UI)

@ -39,7 +39,7 @@ except ImportError:
sys.exit(1) sys.exit(1)
# The root of Blender's source directory. # 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. # Names that don't match this regex can't be used as URL's.
re_name_sanity_match = re.compile("[a-zA-Z0-9._*]+") re_name_sanity_match = re.compile("[a-zA-Z0-9._*]+")
@ -131,7 +131,7 @@ def main():
parser.add_argument( parser.add_argument(
"--output", "--output",
dest="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, required=False,
help="path to output including filename and extentsion", help="path to output including filename and extentsion",
metavar="FILE") metavar="FILE")

@ -13,7 +13,7 @@ from typing import (
Optional, 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 # TODO, move to config file
SOURCE_DIRS = ( SOURCE_DIRS = (

@ -23,7 +23,7 @@ sys.path.append(os.path.join(PWD, "modules"))
from batch_edit_text import run 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. # TODO: move to configuration file.
SOURCE_DIRS = ( SOURCE_DIRS = (

@ -19,7 +19,7 @@ sys.path.append(os.path.join(PWD, "modules"))
from batch_edit_text import run 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 # TODO, move to config file
SOURCE_DIRS = ( SOURCE_DIRS = (

@ -48,7 +48,7 @@ VERBOSE_EDIT_ACTION = False
BASE_DIR = os.path.abspath(os.path.dirname(__file__)) 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, "..", ".."))
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

@ -22,7 +22,7 @@ PATHS = (
SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath( 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( PATHS = tuple(
os.path.join(SOURCE_DIR, p.replace("/", os.sep)) os.path.join(SOURCE_DIR, p.replace("/", os.sep))