Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed May 14, 2024
1 parent d012c1d commit d97ec4b
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/compas_fea2/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
Console script for compas_fea2.
"""

import json
import importlib
import os
import sys

import click
import importlib
import dotenv

from compas_fea2 import HOME, VERBOSE
from compas_fea2 import HOME
from compas_fea2 import VERBOSE

try:
from fea2_extension.main import init_plugin # type: ignore
Expand Down Expand Up @@ -54,21 +54,22 @@ def init_backend(backend, clean):
@click.argument("value")
def change_setting(backend, setting, value):
"""Change a setting for the specified backend.\n
backend : txt\n
The name of the backend.
setting : txt\n
The setting to be changed.
value : txt\n
The new value for the setting.
Example usage:\n
fea2 change-setting opensees exe "Applications/OpenSees3.5.0/bin/OpenSees"
backend : txt\n
The name of the backend.
setting : txt\n
The setting to be changed.
value : txt\n
The new value for the setting.
Example usage:\n
fea2 change-setting opensees exe "Applications/OpenSees3.5.0/bin/OpenSees"
"""
m = importlib.import_module("compas_fea2_"+backend.lower())
env = os.path.join(m.HOME,"src", "compas_fea2_"+backend.lower(),".env")
m = importlib.import_module("compas_fea2_" + backend.lower())
env = os.path.join(m.HOME, "src", "compas_fea2_" + backend.lower(), ".env")
dotenv.set_key(env, setting.upper(), value)
print(f"{setting.upper()} set to {value} for compas_fea2_{backend.lower()}")


# -------------------------------- DEBUG ----------------------------------#
if __name__ == "__main__":
sys.exit(main.init_backend())

0 comments on commit d97ec4b

Please sign in to comment.