mirror of
https://github.com/jorisvink/kore
synced 2025-03-10 04:59:02 -04:00
Add python_path configuration option.
Allows adding more items to the python path so imports from inside python scripts work more sensible depending on how you configure your app.
This commit is contained in:
parent
823e76f582
commit
ff21fd330f
10
src/config.c
10
src/config.c
@ -107,6 +107,7 @@ static int configure_task_threads(char *);
|
||||
#endif
|
||||
|
||||
#if defined(KORE_USE_PYTHON)
|
||||
static int configure_python_path(char *);
|
||||
static int configure_python_import(char *);
|
||||
#endif
|
||||
|
||||
@ -121,6 +122,7 @@ static struct {
|
||||
{ "bind", configure_bind },
|
||||
{ "load", configure_load },
|
||||
#if defined(KORE_USE_PYTHON)
|
||||
{ "python_path", configure_python_path },
|
||||
{ "python_import", configure_python_import },
|
||||
#endif
|
||||
{ "domain", configure_domain },
|
||||
@ -1137,6 +1139,14 @@ configure_task_threads(char *option)
|
||||
#endif
|
||||
|
||||
#if defined(KORE_USE_PYTHON)
|
||||
static int
|
||||
configure_python_path(char *path)
|
||||
{
|
||||
kore_python_path(path);
|
||||
|
||||
return (KORE_RESULT_OK);
|
||||
}
|
||||
|
||||
static int
|
||||
configure_python_import(char *module)
|
||||
{
|
||||
|
@ -147,6 +147,12 @@ kore_python_cleanup(void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
kore_python_path(const char *path)
|
||||
{
|
||||
python_append_path(path);
|
||||
}
|
||||
|
||||
static void *
|
||||
python_malloc(void *ctx, size_t len)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user