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`.
22 lines
502 B
Python
22 lines
502 B
Python
#
|
|
# This file is distributed under the MIT License. See LICENSE.md for details.
|
|
#
|
|
|
|
import json
|
|
import os
|
|
from base64 import b64encode
|
|
from typing import Dict, Optional
|
|
|
|
|
|
def project_workdir() -> Optional[str]:
|
|
return os.environ.get("REVNG_DATA_DIR")
|
|
|
|
|
|
def produce_serializer(input_: Dict[str, str | bytes]) -> str:
|
|
return json.dumps(
|
|
{
|
|
key: (value if isinstance(value, str) else b64encode(value).decode("utf-8"))
|
|
for key, value in input_.items()
|
|
}
|
|
)
|