From 41cc2c0e27e6a0860d21754ed9d13f6cd61254ac Mon Sep 17 00:00:00 2001 From: Arvydas Sidorenko Date: Fri, 15 Jun 2012 18:07:05 +0200 Subject: Ported vicious.widgets module to lua 5.2 Signed-off-by: Arvydas Sidorenko Signed-off-by: Adrian C. (anrxc) --- widgets/thermal.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'widgets/thermal.lua') diff --git a/widgets/thermal.lua b/widgets/thermal.lua index c81431f..7592b72 100644 --- a/widgets/thermal.lua +++ b/widgets/thermal.lua @@ -13,7 +13,8 @@ local helpers = require("vicious.helpers") -- Thermal: provides temperature levels of ACPI and coretemp thermal zones -module("vicious.widgets.thermal") +-- vicious.widgets.thermal +local thermal = {} -- {{{ Thermal widget type @@ -28,9 +29,9 @@ local function worker(format, warg) warg = type(warg) == "table" and warg or { warg, "sys" } -- Get temperature from thermal zone - local thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1]) + local _thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1]) - local data = warg[3] and thermal[warg[3]] or thermal[zone[warg[2]].file] + local data = warg[3] and _thermal[warg[3]] or _thermal[zone[warg[2]].file] if data then if zone[warg[2]].div then return {data / zone[warg[2]].div} @@ -43,4 +44,4 @@ local function worker(format, warg) end -- }}} -setmetatable(_M, { __call = function(_, ...) return worker(...) end }) +return setmetatable(thermal, { __call = function(_, ...) return worker(...) end }) -- cgit v1.2.3