From d4595bb00f1365c65fddf11efd7d8d091b453482 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Fri, 7 Aug 2009 17:41:10 +0200 Subject: All worker functions are local. --- bat.lua | 2 +- batat.lua | 2 +- cpu.lua | 2 +- cpufreq.lua | 2 +- cpuinf.lua | 2 +- date.lua | 2 +- dio.lua | 2 +- entropy.lua | 2 +- fs.lua | 2 +- hddtemp.lua | 2 +- load.lua | 2 +- mbox.lua | 2 +- mboxc.lua | 2 +- mdir.lua | 2 +- mem.lua | 2 +- mpd.lua | 2 +- net.lua | 2 +- org.lua | 2 +- pacman.lua | 2 +- thermal.lua | 2 +- uptime.lua | 2 +- volume.lua | 2 +- weather.lua | 2 +- wifi.lua | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/bat.lua b/bat.lua index 245eb22..26b251c 100644 --- a/bat.lua +++ b/bat.lua @@ -21,7 +21,7 @@ module("vicious.bat") -- {{{ Battery widget type -function worker(format, batid) +local function worker(format, batid) -- Initialise tables local battery_state = { ["full"] = "↯", diff --git a/batat.lua b/batat.lua index 7ab004c..37224af 100644 --- a/batat.lua +++ b/batat.lua @@ -15,7 +15,7 @@ module("vicious.batat") -- {{{ Battery widget type -function worker(format) +local function worker(format) -- Initialise tables local battery_info = {} local battery_state = { diff --git a/cpu.lua b/cpu.lua index c208d2c..5251670 100644 --- a/cpu.lua +++ b/cpu.lua @@ -22,7 +22,7 @@ local cpu_total = {} local cpu_active = {} -- {{{ CPU widget type -function worker(format) +local function worker(format) -- Get /proc/stat local f = io.open("/proc/stat") local cpu_lines = {} diff --git a/cpufreq.lua b/cpufreq.lua index 550bba3..ef0fbc0 100644 --- a/cpufreq.lua +++ b/cpufreq.lua @@ -18,7 +18,7 @@ module("vicious.cpufreq") -- {{{ CPU frequency widget type -function worker(format, cpuid) +local function worker(format, cpuid) -- Initialise tables --local governor_state = { -- ["ondemand"] = "↯", diff --git a/cpuinf.lua b/cpuinf.lua index 76514b9..bb34880 100644 --- a/cpuinf.lua +++ b/cpuinf.lua @@ -15,7 +15,7 @@ module("vicious.cpuinf") -- {{{ CPU Information widget type -function worker(format) +local function worker(format) -- Initialise variables cpu_id = nil diff --git a/date.lua b/date.lua index dfdeaba..aa7ac2f 100644 --- a/date.lua +++ b/date.lua @@ -14,7 +14,7 @@ module("vicious.date") -- {{{ Date widget type -function worker(format) +local function worker(format) -- Get format if format == nil then return os.date() diff --git a/dio.lua b/dio.lua index 4e394a4..e77407c 100644 --- a/dio.lua +++ b/dio.lua @@ -22,7 +22,7 @@ local disk_usage = {} local disk_total = {} -- {{{ Disk I/O widget type -function worker(format, disk) +local function worker(format, disk) -- Get /proc/diskstats local f = io.open("/proc/diskstats") local disk_lines = {} diff --git a/entropy.lua b/entropy.lua index 33da459..1146a0e 100644 --- a/entropy.lua +++ b/entropy.lua @@ -16,7 +16,7 @@ module("vicious.entropy") -- {{{ Entropy widget type -function worker(format, poolsize) +local function worker(format, poolsize) -- Don't waste time opening the poolsize, Linux 2.6 has a default -- entropy pool of 4096-bits, if needed specify otherwise if poolsize == nil then poolsize = 4096 end diff --git a/fs.lua b/fs.lua index f4ccf0f..afefab3 100644 --- a/fs.lua +++ b/fs.lua @@ -14,7 +14,7 @@ module("vicious.fs") -- {{{ Filesystem widget type -function worker(format) +local function worker(format) -- Get data from df local f = io.popen("df -hP") local fs_info = {} diff --git a/hddtemp.lua b/hddtemp.lua index e703278..0cc6c20 100644 --- a/hddtemp.lua +++ b/hddtemp.lua @@ -14,7 +14,7 @@ module("vicious.hddtemp") -- {{{ HDD Temperature widget type -function worker(format, port) +local function worker(format, port) -- Fallback to default hddtemp port if port == nil then port = 7634 end diff --git a/load.lua b/load.lua index a8d6971..8f4c3e0 100644 --- a/load.lua +++ b/load.lua @@ -14,7 +14,7 @@ module("vicious.load") -- {{{ Load widget type -function worker(format) +local function worker(format) -- Get load averages local f = io.open('/proc/loadavg') local line = f:read("*line") diff --git a/mbox.lua b/mbox.lua index d5c1b56..c73236c 100644 --- a/mbox.lua +++ b/mbox.lua @@ -16,7 +16,7 @@ module("vicious.mbox") -- {{{ Mailbox widget type -function worker(format, mbox) +local function worker(format, mbox) local f = io.open(mbox) -- mbox could be huge, get a 15kb chunk from EOF -- * attachments could be much bigger than this diff --git a/mboxc.lua b/mboxc.lua index 73dbe4e..bc67896 100644 --- a/mboxc.lua +++ b/mboxc.lua @@ -15,7 +15,7 @@ module("vicious.mboxc") -- {{{ Mbox count widget type -function worker(format, mbox) +local function worker(format, mbox) -- Initialise counters local old = 0 local total = 0 diff --git a/mdir.lua b/mdir.lua index 63ce1c2..520592a 100644 --- a/mdir.lua +++ b/mdir.lua @@ -15,7 +15,7 @@ module("vicious.mdir") -- {{{ Maildir widget type -function worker(format, mdir) +local function worker(format, mdir) -- Like with the mbox count widget, we would benefit from the -- LuaFileSystem library. However, we didn't rely on extra -- libraries to this point so we won't start now. Widgets like diff --git a/mem.lua b/mem.lua index 34467fe..9a38305 100644 --- a/mem.lua +++ b/mem.lua @@ -16,7 +16,7 @@ module("vicious.mem") -- {{{ Memory widget type -function worker(format) +local function worker(format) -- Get meminfo local f = io.open("/proc/meminfo") diff --git a/mpd.lua b/mpd.lua index bb193b5..ebfd916 100644 --- a/mpd.lua +++ b/mpd.lua @@ -15,7 +15,7 @@ module("vicious.mpd") -- {{{ MPD widget type -function worker(format) +local function worker(format) -- This one is as simple as they come. Using sockets or expanding -- it is a lost cause since there are already a few MPD Lua libs -- written for awesome. Use them. diff --git a/net.lua b/net.lua index 6e7163e..6ddd25d 100644 --- a/net.lua +++ b/net.lua @@ -20,7 +20,7 @@ module("vicious.net") local nets = {} -- {{{ Net widget type -function worker(format) +local function worker(format) -- Get /proc/net/dev local f = io.open("/proc/net/dev") local args = {} diff --git a/org.lua b/org.lua index a4c1754..d0a2315 100644 --- a/org.lua +++ b/org.lua @@ -20,7 +20,7 @@ module("vicious.org") -- {{{ OrgMode widget type -function worker(format, files) +local function worker(format, files) -- Compute delays local today = os.time{ year=os.date("%Y"), month=os.date("%m"), day=os.date("%d") } local soon = today + 24 * 3600 * 3 -- 3 days ahead is close diff --git a/pacman.lua b/pacman.lua index f4fedbf..0bcb2c8 100644 --- a/pacman.lua +++ b/pacman.lua @@ -15,7 +15,7 @@ module("vicious.pacman") -- {{{ Pacman widget type -function worker(format) +local function worker(format) -- Check if updates are available local f = io.popen("pacman -Qu") diff --git a/thermal.lua b/thermal.lua index d84d3f3..6c792e7 100644 --- a/thermal.lua +++ b/thermal.lua @@ -14,7 +14,7 @@ module("vicious.thermal") -- {{{ Thermal widget type -function worker(format, thermal_zone) +local function worker(format, thermal_zone) -- Get thermal zone local f = io.open("/proc/acpi/thermal_zone/" .. thermal_zone .. "/temperature") local line = f:read("*line") diff --git a/uptime.lua b/uptime.lua index 8254f4c..83485e4 100644 --- a/uptime.lua +++ b/uptime.lua @@ -16,7 +16,7 @@ module("vicious.uptime") -- {{{ Uptime widget type -function worker(format) +local function worker(format) -- Get /proc/uptime local f = io.open("/proc/uptime") local line = f:read("*line") diff --git a/volume.lua b/volume.lua index 14a7b0f..603b9d3 100644 --- a/volume.lua +++ b/volume.lua @@ -15,7 +15,7 @@ module("vicious.volume") -- {{{ Volume widget type -function worker(format, channel) +local function worker(format, channel) -- Get mixer data local f = io.popen("amixer get " .. channel) local mixer = f:read("*all") diff --git a/weather.lua b/weather.lua index 3dba976..17e41ac 100644 --- a/weather.lua +++ b/weather.lua @@ -16,7 +16,7 @@ module("vicious.weather") -- {{{ Weather widget type -function worker(format, station) +local function worker(format, station) -- US National Oceanic and Atmospheric Administration -- * Station codes: http://www.rap.ucar.edu/weather/surface/stations.txt local noaa = "http://weather.noaa.gov/pub/data/observations/metar/decoded/" diff --git a/wifi.lua b/wifi.lua index 0e284c8..11d9b84 100644 --- a/wifi.lua +++ b/wifi.lua @@ -18,7 +18,7 @@ module("vicious.wifi") -- {{{ Wireless widget type -function worker(format, iface) +local function worker(format, iface) -- Get data from iwconfig, on distributions where it is executable -- by users, and /sbin or /usr/sbin is in their path local f = io.popen("iwconfig " .. iface) -- cgit v1.2.3