diff --git a/GH/PyGH/components/scriptsynccpy/code.py b/GH/PyGH/components/scriptsynccpy/code.py index 006f9bb..98753e5 100644 --- a/GH/PyGH/components/scriptsynccpy/code.py +++ b/GH/PyGH/components/scriptsynccpy/code.py @@ -298,11 +298,23 @@ def safe_exec(self, path, globals, locals): """ try: with open(path, 'r') as f: - # add the path of the file to use the modules + # add the path and sub directories to the sys path path_dir = os.path.dirname(path) - sys.path.insert(0, path_dir) + sub_dirs = [] + for root, dirs, files in os.walk(path_dir): + for d in dirs: + sub_dirs.append(os.path.join(root, d)) + sys.path.extend([path_dir] + sub_dirs) + + # reload all the modules also of the sub directories + for root, dirs, files in os.walk(path_dir): + for d in dirs: + self.reload_all_modules(os.path.join(root, d)) self.reload_all_modules(path_dir) + # refresh the python interpreter + importlib.invalidate_caches() + # parse the code code = compile(f.read(), path, 'exec') output = io.StringIO() diff --git a/GH/PyGH/examples/qwe.png b/GH/PyGH/examples/qwe.png new file mode 100644 index 0000000..2b7fd48 Binary files /dev/null and b/GH/PyGH/examples/qwe.png differ diff --git a/VSCode/scriptsync/package.json b/VSCode/scriptsync/package.json index 74cbb05..b67afbb 100644 --- a/VSCode/scriptsync/package.json +++ b/VSCode/scriptsync/package.json @@ -11,7 +11,7 @@ "type": "git", "url": "https://github.com/ibois-epfl/script-sync" }, - "version": "1.1.2", + "version": "1.1.3", "engines": { "vscode": "^1.85.0" }, diff --git a/yaker/Newtonsoft.Json.Rhino.dll b/yaker/Newtonsoft.Json.Rhino.dll new file mode 100644 index 0000000..2de2ae8 Binary files /dev/null and b/yaker/Newtonsoft.Json.Rhino.dll differ