16 lines
427 B
Python
16 lines
427 B
Python
from funcy import compose, identity
|
|
|
|
from pyinfra.server.normalization import normalize
|
|
from pyinfra.server.packing import unpack_fn_pack
|
|
from pyinfra.utils.func import starlift
|
|
|
|
|
|
def make_streamable_and_wrap_in_packing_logic(fn, batched):
|
|
fn = make_streamable(fn, batched)
|
|
fn = unpack_fn_pack(fn)
|
|
return fn
|
|
|
|
|
|
def make_streamable(fn, batched):
|
|
return compose(normalize, (identity if batched else starlift)(fn))
|