diff options
author | Laurie Clark-Michalek <bluepeppers@archlinux.us> | 2010-11-19 14:35:43 +0000 |
---|---|---|
committer | Laurie Clark-Michalek <bluepeppers@archlinux.us> | 2010-11-19 14:35:43 +0000 |
commit | 889f7f0fc2f845df0991ff50e9704b139dacba14 (patch) | |
tree | a05fd7913425c29b2e0c3bca90b9516f18cded02 | |
parent | d578a10a5156ad81bb7192f20c39a724437fc021 (diff) |
Allow display classes to fail silently when rendering.
-rw-r--r-- | archey.new | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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)) |