From 889f7f0fc2f845df0991ff50e9704b139dacba14 Mon Sep 17 00:00:00 2001 From: Laurie Clark-Michalek Date: Fri, 19 Nov 2010 14:35:43 +0000 Subject: Allow display classes to fail silently when rendering. --- archey.new | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/archey.new b/archey.new index 2f69914..ed399bc 100644 --- a/archey.new +++ b/archey.new @@ -215,8 +215,16 @@ class Output(list): results = self._get_results() unformatted_stn = '{color}{key}: {clear}{value}{clear}' - pretty_results = [unformatted_stn.format(color=self._color(1), key=key, value=value, clear=self._color('Clear')) - for key, value in results.items()] + pretty_results = [] + for key, value in results.items(): + try: + formatted_stn = unformatted_stn.format(color=self._color(1), key=key, value=value, + clear=self._color('Clear')) + except: + #Fail silently, have a debug option later for noisy fail? + pass + else: + pretty_results.append(formatted_stn) centered_results = self._center_results(pretty_results) print(self._get_logo().format(color=self._color(self.distro), results=centered_results)) -- cgit v1.2.3-54-g00ecf