2019-06-02 18:35:36 -03:00

16 lines
393 B
Python

# -*- coding: utf-8 -*-
from collections import Sequence
def binary(arg,yes_value='yes',no_value='no'):
''' Convert boolean argument to 'yes' or 'no' string value '''
if isinstance(arg, bool):
if arg:
return yes_value
return no_value
return arg
class FilterModule(object):
def filters(self):
return {
'binary': binary
}