Private
Public Access
2
0

move filter_plugins/ inside role caddy

This commit is contained in:
2026-01-20 17:42:23 +03:00
parent b78da80550
commit ebe4f15c0f
2 changed files with 0 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
#!/usr/bin/python
class FilterModule(object):
def filters(self):
return {
'dict2str': self.dict2str
}
def dict2str(self, d, sep1='=', sep2=';', sep3=''):
return sep2.join(
[ str(k) + (sep1+str(v) if v!=None and v!='' else '') for k, v in d.items() ]
) + sep3
if __name__ == "__main__":
# Tests
filters = FilterModule()
print(filters.filters())
print(filters.dict2str(
{"un": 1, "deux": 2, "str": "a string", "rien": None, "bool": True}
))