diff options
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..1ba7137 --- /dev/null +++ b/utils.py @@ -0,0 +1,14 @@ +#!/usr/bin/python2 + +def get_os_name(name): + try: return name.split(' ')[0].lower() + except: pass + +def select_with_attribute(iterable, attribute, result=True): + return [value for value in iterable if (attribute in value) == result] + + +filters = [ + ('select_with_attribute', select_with_attribute), + ('get_os_name', get_os_name) +] |