Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address dlite-validate output confusing information #988

Closed
Closed
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
15 changes: 15 additions & 0 deletions bindings/python/scripts/dlite-validate
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,23 @@ import sys
import argparse
import json
import re
import ctypes
from ctypes.util import find_library
from pathlib import Path

# Silence warning about behavior by setting environment variable
# DLITE_BEHAVIOR=OFF before importing dlite.
# This must be done at c-level outside os.environ.
clib = find_library("c")
dll = ctypes.CDLL(clib)
setenv = dll.setenv
setenv.argtypes = [
ctypes.POINTER(ctypes.c_char), # name
ctypes.POINTER(ctypes.c_char), # value
ctypes.c_int, # overwrite
]
setenv(b"DLITE_BEHAVIOR", b"OFF", 1)

import dlite


Expand Down
2 changes: 1 addition & 1 deletion src/dlite-behavior.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int dlite_behavior_get(const char *name)
const char *ver = dlite_get_version(); // current version
b->value = (strcmp_semver(ver, b->version_new) >= 0) ? 1 : 0;

dlite_warnx("Behavior `%s` is not configured. "
dlite_warnx("Behavior change `%s` is not configured. "
"It will be enabled by default from v%s. "
"See https://sintef.github.io/dlite/user_guide/configure_behavior_changes.html for more info.",
b->name, b->version_new);
Expand Down