diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-02 20:33:58 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-02 21:58:28 +0200 |
commit | c76108764f154949200193d66e9767947c406bba (patch) | |
tree | 0cc87e8a2a64da0895368ebec252fde078dc6efc | |
parent | d1d5c17b47fccf429d54c2a8f5ae4cc914e6bd01 (diff) | |
download | vicious-legacy-c76108764f154949200193d66e9767947c406bba.tar.xz |
bat: coding style changes
-rw-r--r-- | bat.lua | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -31,9 +31,9 @@ local function worker(format, batid) } -- Get /proc/acpi/battery info - local finfo = io.open("/proc/acpi/battery/"..batid.."/info") - local infofile = finfo:read("*all") - finfo:close() + local f = io.open("/proc/acpi/battery/"..batid.."/info") + local infofile = f:read("*all") + f:close() -- Check if the file wasn't found or the battery isn't present if infofile == nil or string.find(infofile, "present:[%s]+no") then @@ -44,9 +44,9 @@ local function worker(format, batid) -- Get /proc/acpi/battery state - local fstate = io.open("/proc/acpi/battery/"..batid.."/state") - local statefile = fstate:read("*all") - fstate:close() + local f = io.open("/proc/acpi/battery/"..batid.."/state") + local statefile = f:read("*all") + f:close() -- Get state information local state = string.match(statefile, "charging state:[%s]+([%a]+).*") |