diff options
author | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2013-05-23 15:06:32 +0200 |
---|---|---|
committer | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2013-05-23 15:06:32 +0200 |
commit | ab825994f13821891559a749f0b9d4c46a4fb1f6 (patch) | |
tree | bc986eeeb1ff7097d4ffd21c40ad07a2f1826033 /utils.py | |
parent | 089900ba33f49ab9113a096b1853837999d56152 (diff) | |
download | www-ab825994f13821891559a749f0b9d4c46a4fb1f6.tar.gz www-ab825994f13821891559a749f0b9d4c46a4fb1f6.tar.bz2 www-ab825994f13821891559a749f0b9d4c46a4fb1f6.zip |
Refactored: index page
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) +] |