mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
79c6086d0d
`revng.api` now autodetects files (libraries, pipeline yamls) for initialization via the same mechanism used by `revng.cli`. This removes the need to pass them via environment variables from `revng daemon` and allows easy interaction with python's C API.
24 lines
520 B
Python
24 lines
520 B
Python
#
|
|
# This file is distributed under the MIT License. See LICENSE.md for details.
|
|
#
|
|
# flake8: noqa: F401
|
|
|
|
from tempfile import mkdtemp
|
|
from typing import Optional
|
|
|
|
from revng.support import AnyPath
|
|
|
|
from ._capi import initialize
|
|
from .manager import Manager
|
|
from .rank import Rank
|
|
|
|
_initialized = False
|
|
|
|
|
|
def make_manager(workdir: Optional[AnyPath] = None):
|
|
global _initialized
|
|
if not _initialized:
|
|
initialize()
|
|
_initialized = True
|
|
return Manager(workdir if workdir is not None else mkdtemp())
|