30 lines
504 B
Python
30 lines
504 B
Python
def string_wrap(
|
|
value,
|
|
character_open,
|
|
character_close,
|
|
options = None
|
|
):
|
|
options = (
|
|
{
|
|
"mode": True,
|
|
}
|
|
|
|
|
(options or {})
|
|
)
|
|
return (
|
|
(character_open + value + character_close)
|
|
if options["mode"] else
|
|
value
|
|
)
|
|
|
|
|
|
def string_coin(
|
|
template,
|
|
arguments
|
|
):
|
|
result = template
|
|
for (key, value, ) in arguments.items():
|
|
result = result.replace("{{%s}}" % key, value)
|
|
return result
|
|
|