aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2013-12-18 22:52:48 +0100
committermakefu <root@pigstarter.de>2013-12-18 22:52:51 +0100
commit843c254b6b868b3b83f20fdfef4d620d4be83a8b (patch)
tree077a4e14ec55c5ae04d55e24118ac9651b2b6d08 /commands
parent024e3791026b166e6678350444eff83e5a9b13e0 (diff)
Reaktor: caps resolver is now pythonic
Diffstat (limited to 'commands')
-rwxr-xr-xcommands/caps9
1 files changed, 1 insertions, 8 deletions
diff --git a/commands/caps b/commands/caps
index eb1d97a..a9ce451 100755
--- a/commands/caps
+++ b/commands/caps
@@ -8,12 +8,5 @@ def load_config(filename):
file, pathname, description = imp.find_module(modname, [ dirname ])
return imp.load_module(modname, file, pathname, description)
-def not_none(x):
- return x != None
-
-def pluck(name):
- return lambda x: name in x.keys() and x[name] or None
-
config = load_config(os.environ['config_filename'])
-
-print(' '.join(filter(not_none, map(pluck('capname'), config.irc_commands))))
+print(' '.join(filter(None,[ x.get('capname',None) for x in config.irc_commands])))