Commits

Anonymous committed d2c65f5

Added static system information.

Comments (0)

Files changed (1)

 from collections import defaultdict, deque
 from datetime import datetime
 from functools import partial
+from platform import uname
 from subprocess import check_output
 
 
 __author__ = 'Thorsten Weimann'
-__version__ = '0.2'
+__version__ = '0.3'
 __license__ = 'MIT'
 
 SLEEP_SECS = 5.0
 DEFAULT_FORMAT = (
-    'CPU: {model}@{speed:<5} ESSID: {essid} [{quality}] '
+    'CPU: {model}@{speed:<5} '
+    'ESSID: {essid} [{quality}] '
+    '{system} {release} {machine} '
     'Gmail: {gmail_count:<3} {date} {time}'
 )
 GMAIL_REALM = 'New mail feed'
 GMAIL_URI = 'https://mail.google.com/mail/feed/atom'
 ENC = sys.getfilesystemencoding()
+SYSINFO = uname()._asdict()
 
 # re's
 net = {
         sleep_secs : float
             Time to sleep after every loop.
 
+    Some static keys are present in the context (from uname output)::
+
+        system, node, release, version, machine, processor
+
+    Note that some values from uname can be empty. See Python docs
+    (platform.uname) for details.
+
     Kill the loop with CTRL+C (when testing).
     """
+    d = defaultdict(lambda: '-', SYSINFO)
     try:
         while True:
-            d = defaultdict(lambda: '-')
             for func in actions:
                 try:
                     ret = func()