Removed some useless else statements

This commit is contained in:
Adrian C. (anrxc) 2009-10-04 00:54:27 +02:00
parent b65d509380
commit b4e028b21f
3 changed files with 76 additions and 78 deletions

View File

@ -38,7 +38,8 @@ local function worker(format, batid)
-- Check if the file wasn't found or the battery isn't present
if infofile == nil or string.find(infofile, "present:[%s]+no") then
return {"/", "/", "/"}
else
end
-- Get capacity information
local capacity = string.match(infofile, "last full capacity:[%s]+([%d]+).*")
@ -74,7 +75,6 @@ local function worker(format, batid)
local time = string.format("%02d:%02d", hoursleft, minutesleft)
return {state, percent, time}
end
end
-- }}}

View File

@ -41,9 +41,8 @@ local function worker(format, station)
}
-- Check if there was a timeout or a problem with the station
if ws == nil then
return weather
else
if ws == nil then return weather end
weather["{city}"] = -- City and/or area
string.match(ws, "^(.+)%,.*%([%u]+%)") or weather["{city}"]
weather["{wind}"] = -- Wind direction and degrees if available
@ -67,7 +66,6 @@ local function worker(format, station)
if weather["{windmph}"] ~= "N/A" then
weather["{windkmh}"] = math.floor(weather["{windmph}"] * 1.6)
end
end
return weather
end

View File

@ -38,7 +38,8 @@ local function worker(format, iface)
-- interface is not a wireless one
if iw == nil or string.find(iw, "No such device") then
return winfo
else
end
-- The output differs from system to system, some stats can
-- be separated by =, and not all drivers report all stats
winfo["{ssid}"] = -- SSID can have almost anything in it
@ -55,7 +56,6 @@ local function worker(format, iface)
string.match(iw, "Link Quality[=:]([%d]+)") or winfo["{link}"]
winfo["{sign}"] = -- Signal level can be a negative value, also display decibel notation
string.match(iw, "Signal level[=:]([%-%d]+[%s][%a]*)") or winfo["{sign}"]
end
return winfo
end