Compare commits
12 commits
001ab5edef
...
071bc8cc8d
Author | SHA1 | Date | |
---|---|---|---|
![]() |
071bc8cc8d | ||
![]() |
a9c0e91ea8 | ||
![]() |
dbcf21d807 | ||
![]() |
4c5db6abcf | ||
![]() |
d524734aa9 | ||
![]() |
3dbcf919b1 | ||
![]() |
cd7981cf86 | ||
![]() |
b478677221 | ||
![]() |
2904f62b41 | ||
![]() |
dd28bfee7b | ||
![]() |
9d28cf2e8e | ||
![]() |
01f3606f3d |
1 changed files with 3 additions and 5 deletions
8
nodes.py
8
nodes.py
|
@ -1,6 +1,5 @@
|
|||
from os import walk
|
||||
from os.path import join, basename, splitext
|
||||
from re import search
|
||||
|
||||
converters = {
|
||||
'32_random_bytes_as_base64_for': lambda x: vault.random_bytes_as_base64_for(x, length=32),
|
||||
|
@ -11,10 +10,9 @@ converters = {
|
|||
|
||||
def demagify(data):
|
||||
if isinstance(data, str):
|
||||
match = search(r'^\!([0-9a-zA-Z_-]{,255})\:(.*)$', data)
|
||||
if match:
|
||||
magicstring, content = match.groups()
|
||||
return converters[magicstring](content)
|
||||
for name, converter in converters.items():
|
||||
if data.startswith(f'!{name}:'):
|
||||
return converter(data[len(name) + 2:])
|
||||
else:
|
||||
return data
|
||||
elif isinstance(data, dict):
|
||||
|
|
Loading…
Reference in a new issue