[modules/kernel] Use Python standard module "platform"

Instead of executing an external call to "uname", use the standard
Python module "platform" to retrieve information about the kernel used.

Positive side-effect: This is portable, if i3 ever exists on Windows :P
This commit is contained in:
Tobi-wan Kenobi 2017-03-03 19:18:25 +01:00
parent 955f123b88
commit fe5bbd4b46

View file

@ -2,6 +2,8 @@
"""Shows Linux kernel version information""" """Shows Linux kernel version information"""
import platform
import bumblebee.input import bumblebee.input
import bumblebee.output import bumblebee.output
import bumblebee.engine import bumblebee.engine
@ -11,7 +13,7 @@ class Module(bumblebee.engine.Module):
super(Module, self).__init__(engine, config, super(Module, self).__init__(engine, config,
bumblebee.output.Widget(full_text=self.output) bumblebee.output.Widget(full_text=self.output)
) )
self._release_name = bumblebee.util.execute("uname -r")[:-1] self._release_name = platform.release()
def output(self, widget): def output(self, widget):
return self._release_name return self._release_name