summaryrefslogtreecommitdiff
path: root/archey.new
diff options
context:
space:
mode:
authorLaurie Clark-Michalek <bluepeppers@archlinux.us>2010-11-19 14:35:43 +0000
committerLaurie Clark-Michalek <bluepeppers@archlinux.us>2010-11-19 14:35:43 +0000
commit889f7f0fc2f845df0991ff50e9704b139dacba14 (patch)
treea05fd7913425c29b2e0c3bca90b9516f18cded02 /archey.new
parentd578a10a5156ad81bb7192f20c39a724437fc021 (diff)
Allow display classes to fail silently when rendering.
Diffstat (limited to 'archey.new')
-rw-r--r--archey.new12
1 files 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))