mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
942cf50735
Package revng's python code in two wheels: `revng` and `revng_internal`.
The revng wheel contains the
`revng.{pipeline_description,model,tupletree}` modules, while the
`revng_internal` one everything under `revng.internal`.
29 lines
598 B
Python
29 lines
598 B
Python
#
|
|
# This file is distributed under the MIT License. See LICENSE.md for details.
|
|
#
|
|
|
|
import atexit
|
|
from typing import Optional
|
|
|
|
from revng.internal.support import AnyPath
|
|
|
|
from ._capi import initialize, shutdown
|
|
from .manager import Manager
|
|
|
|
__all__ = ["Manager", "initialize", "shutdown"]
|
|
|
|
_initialized = False
|
|
|
|
|
|
def make_manager(workdir: Optional[AnyPath] = None):
|
|
global _initialized
|
|
if not _initialized:
|
|
initialize()
|
|
atexit.register(shutdown)
|
|
_initialized = True
|
|
|
|
if workdir is None:
|
|
return Manager(None)
|
|
else:
|
|
return Manager(str(workdir))
|