diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-08-31 19:37:08 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-08-31 19:37:08 +0200 |
commit | 5fc328ec0545c1183b0a2bcb26196fbd06b2be95 (patch) | |
tree | 04e0941340ccf95f7a51930daba6476b9ccb5849 /src/plugins/uname.py | |
parent | use the devfs method by default in Users (diff) | |
download | xpybar-5fc328ec0545c1183b0a2bcb26196fbd06b2be95.tar.gz xpybar-5fc328ec0545c1183b0a2bcb26196fbd06b2be95.tar.bz2 xpybar-5fc328ec0545c1183b0a2bcb26196fbd06b2be95.tar.xz |
do not spawn new processes all the time
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/plugins/uname.py')
-rw-r--r-- | src/plugins/uname.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/plugins/uname.py b/src/plugins/uname.py index 6b05a96..19c8fca 100644 --- a/src/plugins/uname.py +++ b/src/plugins/uname.py @@ -17,6 +17,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' +import os + from util import * @@ -40,11 +42,7 @@ class Uname: Constructor ''' u = lambda s : None if s == 'unknown' else s - self.kernel_name = spawn_read('uname', '-s') - self.nodename = spawn_read('uname', '-n') - self.kernel_release = spawn_read('uname', '-r') - self.kernel_version = spawn_read('uname', '-v') - self.machine = spawn_read('uname', '-m') + (self.kernel_name, self.nodename, self.kernel_release, self.kernel_version, self.machine) = os.uname() self.processor = u(spawn_read('uname', '-p')) self.hardware_platform = u(spawn_read('uname', '-i')) self.operating_system = spawn_read('uname', '-o') |