Files
revng-revng/python/revng/api/__init__.py
Giacomo Vercesi 93d3a6238d revng: introduce S3 support
Add the capability for all revng tooling to run with an S3-backed
workdir.
2023-09-06 15:23:43 +02:00

30 lines
620 B
Python

#
# This file is distributed under the MIT License. See LICENSE.md for details.
#
import atexit
from typing import Optional
from revng.support import AnyPath
from ._capi import initialize, shutdown
from .manager import Manager
from .rank import Rank
__all__ = ["Manager", "Rank", "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))