Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"comments": {
"lineComment": "#"
},
"brackets": [
["(", ")"],
["[", "]"],
["{", "}"]
],
"autoClosingPairs": [
{ "open": "(", "close": ")" },
{ "open": "[", "close": "]" },
{ "open": "{", "close": "}" },
{ "open": "\"", "close": "\"" }
]
}
81 changes: 0 additions & 81 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@
"path": "./syntaxes/comm.tmLanguage.json"
}
],
"keybindings": [
{
"command": "editor.action.commentLine",
"key": "ctrl+shift+;",
"when": "editorTextFocus && editorLangId == comm"
}
],
"menus": {
"editor/title": [
{
Expand Down
43 changes: 41 additions & 2 deletions python/med2obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,48 @@


import argparse
import os
import pathlib as pl

import medcoupling as mc
import sys

python_version = sys.version_info

if sys.platform == "win32" and python_version >= (3, 8):
# On Windows, we need to ensure that the DLLs are found, from Python 3.8 we need to
# use os.add_dll_directory to add the directory containing the DLLs.
# Add the directory of the current script to the DLL search path
# This is necessary for Python 3.8+ on Windows to find the DLLs.
# To simplify we use the LD_LIBRARY_PATH environment variable like on Unix systems.
# ld_library_path = os.getenv("LD_LIBRARY_PATH", "")

appdata = os.environ["LOCALAPPDATA"]

if (pl.Path(appdata) / "code_aster").exists():
### Attach to code_aster windows install
python_path = (
rf"{appdata}\code_aster\external\medcoupling-9.11.0\lib\python3.10\site-packages"
)
sys.path.append(python_path)

ld_library_path = [
rf"{appdata}\code_aster\Python3.10",
rf"{appdata}\code_aster\external\hdf51.10.5\bin",
rf"{appdata}\code_aster\external\hdf51.10.5\lib",
rf"{appdata}\code_aster\external\MED-4.4.1\lib",
rf"{appdata}\code_aster\external\medcoupling-9.11.0\lib",
rf"{appdata}\code_aster\external\medcoupling-9.11.0\libpython3.10\site-packages",
rf"{appdata}\code_aster\external",
]

if ld_library_path:
# Split the LD_LIBRARY_PATH and add each directory
for path in ld_library_path:
print("Adding directory:", path)
if os.path.isdir(path):
print(os.add_dll_directory(os.path.abspath(path)))
sys.path.append(path)

import medcoupling as mc # noqa E402


def parse_args():
Expand Down
Loading