widgets: cleanup behind the last commit 363c03e

This commit is contained in:
Adrian C. (anrxc) 2012-06-18 01:30:26 +02:00
parent 363c03e79c
commit e929bea270
3 changed files with 7 additions and 8 deletions

View File

@ -15,7 +15,6 @@ local string = {
sub = string.sub,
gmatch = string.gmatch
}
local naught = require("naughty")
-- }}}
@ -34,8 +33,8 @@ local function worker(format)
local cpu_lines = {}
-- Get CPU stats
local fd = io.open("/proc/stat")
for line in fd:lines() do
local f = io.open("/proc/stat")
for line in f:lines() do
if string.sub(line, 1, 3) ~= "cpu" then break end
cpu_lines[#cpu_lines+1] = {}
@ -44,7 +43,7 @@ local function worker(format)
table.insert(cpu_lines[#cpu_lines], i)
end
end
fd:close()
f:close()
-- Ensure tables are initialized correctly
for i = #cpu_total + 1, #cpu_lines do

View File

@ -33,8 +33,8 @@ local function worker(format, warg)
}
-- Linux manual page: md(4)
local fd = io.open("/proc/mdstat")
for line in fd:lines() do
local f = io.open("/proc/mdstat")
for line in f:lines() do
if mddev[warg]["found"] then
local updev = string.match(line, "%[[_U]+%]")
@ -51,7 +51,7 @@ local function worker(format, warg)
end
end
end
fd:close()
f:close()
return {mddev[warg]["assigned"], mddev[warg]["active"]}
end