kiwix-build/kiwixbuild/_global.py
Matthieu Gautier 20ca39145d Remove backend (internal) option.
This is not used and it is a good things as it is broken..
2024-02-05 11:42:04 +01:00

40 lines
718 B
Python

from collections import OrderedDict as _OrderedDict
import platform
_neutralEnv = None
_options = None
_target_steps = _OrderedDict()
def set_neutralEnv(env):
global _neutralEnv
_neutralEnv = env
def neutralEnv(what):
return getattr(_neutralEnv, what)
def set_options(options):
global _options
_options = options
def option(what):
return getattr(_options, what)
def add_target_step(key, what):
_target_steps[key] = what
def get_target_step(key, default_context=None):
if isinstance(key, tuple):
context, target = key
else:
context, target = default_context, key
return _target_steps[(context, target)]
def target_steps():
return _target_steps