Skip to content
Snippets Groups Projects
Commit 7e414c7c authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

format

parent c4715cb1
No related branches found
No related tags found
No related merge requests found
...@@ -11,23 +11,20 @@ pin.switchToNumpyArray() ...@@ -11,23 +11,20 @@ pin.switchToNumpyArray()
def getModelPath(subpath, printmsg=False): def getModelPath(subpath, printmsg=False):
source = dirname(dirname(dirname(__file__))) # top level source directory source = dirname(dirname(dirname(__file__))) # top level source directory
paths = [ paths = [
join( # function called from "make release" in build/ dir
dirname(dirname(dirname(source))), "robots" join(dirname(dirname(dirname(source))), "robots"),
), # function called from "make release" in build/ dir # function called from a build/ dir inside top level source
join( join(dirname(source), "robots"),
dirname(source), "robots" # function called from top level source dir
), # function called from a build/ dir inside top level source join(source, "robots"),
join(source, "robots"), # function called from top level source dir
] ]
try: try:
from .path import EXAMPLE_ROBOT_DATA_MODEL_DIR, EXAMPLE_ROBOT_DATA_SOURCE_DIR from .path import EXAMPLE_ROBOT_DATA_MODEL_DIR, EXAMPLE_ROBOT_DATA_SOURCE_DIR
paths.append( # function called from installed project
EXAMPLE_ROBOT_DATA_MODEL_DIR paths.append(EXAMPLE_ROBOT_DATA_MODEL_DIR)
) # function called from installed project # function called from off-tree build dir
paths.append( paths.append(EXAMPLE_ROBOT_DATA_SOURCE_DIR)
EXAMPLE_ROBOT_DATA_SOURCE_DIR
) # function called from off-tree build dir
except ImportError: except ImportError:
pass pass
paths += [join(p, "../../../share/example-robot-data/robots") for p in sys.path] paths += [join(p, "../../../share/example-robot-data/robots") for p in sys.path]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment