From 293091d2674bb5b37d461b7989a39b7048800794 Mon Sep 17 00:00:00 2001 From: luke bonham Date: Sun, 26 Jul 2015 00:59:23 +0200 Subject: [PATCH] #121: io.read abbreviations removed --- widgets/abase.lua | 2 +- widgets/alsa.lua | 2 +- widgets/alsabar.lua | 2 +- widgets/base.lua | 2 +- widgets/calendar.lua | 2 +- widgets/fs.lua | 2 +- widgets/imap.lua | 4 ++-- widgets/maildir.lua | 2 +- widgets/net.lua | 2 +- widgets/sysload.lua | 2 +- widgets/temp.lua | 2 +- widgets/weather.lua | 6 +++--- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/widgets/abase.lua b/widgets/abase.lua index 8ffdf0e..1c132cd 100644 --- a/widgets/abase.lua +++ b/widgets/abase.lua @@ -27,7 +27,7 @@ local function worker(args) function abase.update() async.request(cmd, function(f) - output = f:read("*a") + output = f:read("*all") f:close() widget = abase.widget settings() diff --git a/widgets/alsa.lua b/widgets/alsa.lua index 979d9fd..91bf488 100644 --- a/widgets/alsa.lua +++ b/widgets/alsa.lua @@ -33,7 +33,7 @@ local function worker(args) function alsa.update() local f = assert(io.popen(string.format("%s get %s", alsa.cmd, alsa.channel))) - local mixer = f:read("*a") + local mixer = f:read("*all") f:close() volume_now = {} diff --git a/widgets/alsabar.lua b/widgets/alsabar.lua index 2cf1c29..5fe74c4 100644 --- a/widgets/alsabar.lua +++ b/widgets/alsabar.lua @@ -117,7 +117,7 @@ local function worker(args) function alsabar.update() -- Get mixer control contents local f = assert(io.popen(string.format("%s get %s", alsabar.cmd, alsabar.channel))) - local mixer = f:read("*a") + local mixer = f:read("*all") f:close() -- Capture mixer control state: [5%] ... ... [on] diff --git a/widgets/base.lua b/widgets/base.lua index 39b0863..2a7bf10 100644 --- a/widgets/base.lua +++ b/widgets/base.lua @@ -26,7 +26,7 @@ local function worker(args) function base.update() local f = assert(io.popen(cmd)) - output = f:read("*a") + output = f:read("*all") f:close() widget = base.widget settings() diff --git a/widgets/calendar.lua b/widgets/calendar.lua index 3e65f38..2df2f05 100644 --- a/widgets/calendar.lua +++ b/widgets/calendar.lua @@ -85,7 +85,7 @@ function calendar:show(t_out, inc_offset, scr) .. calendar.font_size .. "'>" .. f:read() .. "\n\n" .. f:read() .. "\n" - .. f:read("*a"):gsub("\n*$", "") + .. f:read("*all"):gsub("\n*$", "") .. "" f:close() diff --git a/widgets/fs.lua b/widgets/fs.lua index 951f0cc..07490fa 100644 --- a/widgets/fs.lua +++ b/widgets/fs.lua @@ -40,7 +40,7 @@ function fs:show(t_out) fs:hide() local f = io.popen(helpers.scripts_dir .. "dfs") - ws = f:read("*a"):gsub("\n*$", "") + ws = f:read("*all"):gsub("\n*$", "") f:close() notification = naughty.notify({ diff --git a/widgets/imap.lua b/widgets/imap.lua index 1ebbb76..ea62cc7 100644 --- a/widgets/imap.lua +++ b/widgets/imap.lua @@ -42,7 +42,7 @@ local function worker(args) if not is_plain then local f = io.popen(password) - password = f:read("*a"):gsub("\n", "") + password = f:read("*all"):gsub("\n", "") f:close() end @@ -58,7 +58,7 @@ local function worker(args) head_command, server, port, mail, password, request) async.request(curl, function(f) - ws = f:read("*a") + ws = f:read("*all") f:close() _, mailcount = string.gsub(ws, "%d+", "") diff --git a/widgets/maildir.lua b/widgets/maildir.lua index 246341f..315ae34 100644 --- a/widgets/maildir.lua +++ b/widgets/maildir.lua @@ -53,7 +53,7 @@ local function worker(args) local np = io.popen("find " .. line .. "/new -mindepth 1 -type f " .. "-not -name '.*' -printf a") - local mailstring = np:read("*a") + local mailstring = np:read("*all") -- Strip off leading mailpath. local box = string.match(line, mailpath .. "/*([^/]+)") diff --git a/widgets/net.lua b/widgets/net.lua index 2585ad4..d859d91 100644 --- a/widgets/net.lua +++ b/widgets/net.lua @@ -29,7 +29,7 @@ local net = { function net.get_device() f = io.popen("ip link show | cut -d' ' -f2,9") - ws = f:read("*a") + ws = f:read("*all") f:close() ws = ws:match("%w+: UP") or ws:match("ppp%w+: UNKNOWN") if ws ~= nil then diff --git a/widgets/sysload.lua b/widgets/sysload.lua index b10c5e2..d8e4713 100644 --- a/widgets/sysload.lua +++ b/widgets/sysload.lua @@ -29,7 +29,7 @@ local function worker(args) function update() local f = io.open("/proc/loadavg") - local ret = f:read("*a") + local ret = f:read("*all") f:close() load_1, load_5, load_15 = string.match(ret, "([^%s]+) ([^%s]+) ([^%s]+)") diff --git a/widgets/temp.lua b/widgets/temp.lua index 1e93848..67c9456 100644 --- a/widgets/temp.lua +++ b/widgets/temp.lua @@ -31,7 +31,7 @@ local function worker(args) local f = io.open(tempfile) if f ~= nil then - coretemp_now = tonumber(f:read("*a")) / 1000 + coretemp_now = tonumber(f:read("*all")) / 1000 f:close() else coretemp_now = "N/A" diff --git a/widgets/weather.lua b/widgets/weather.lua index 559d4d2..53ae838 100644 --- a/widgets/weather.lua +++ b/widgets/weather.lua @@ -71,7 +71,7 @@ local function worker(args) function weather.forecast_update() local cmd = string.format(forecast_call, city_id, units, lang, cnt) async.request(cmd, function(f) - j = f:read("*a") + j = f:read("*all") f:close() weather_now, pos, err = json.decode(j, 1, nil) @@ -79,7 +79,7 @@ local function worker(args) weather.notification_text = '' for i = 1, weather_now["cnt"] do local f = assert(io.popen(string.format(date_cmd, weather_now["list"][i]["dt"]))) - day = string.gsub(f:read("*a"), "\n", "") + day = string.gsub(f:read("*all"), "\n", "") f:close() tmin = math.floor(weather_now["list"][i]["temp"]["min"]) @@ -103,7 +103,7 @@ local function worker(args) function weather.update() local cmd = string.format(current_call, city_id, units, lang) async.request(cmd, function(f) - j = f:read("*a") + j = f:read("*all") f:close() weather_now, pos, err = json.decode(j, 1, nil) -- 2.39.5