experiments/apt-widget: fix/silent warnings
- unused function ellipsize - unused variable one - line is too long (146 > 120) - unused argument stdout,stderr - unused loop variable i - shadowing upvalue i on line 131
This commit is contained in:
parent
8cc7b6dbfe
commit
a47ccb782f
|
@ -29,6 +29,7 @@ local function show_warning(message)
|
||||||
text = message}
|
text = message}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- luacheck:ignore ellipsize
|
||||||
local function ellipsize(text, length)
|
local function ellipsize(text, length)
|
||||||
return (text:len() > length and length > 0)
|
return (text:len() > length and length > 0)
|
||||||
and text:sub(0, length - 3) .. '...'
|
and text:sub(0, length - 3) .. '...'
|
||||||
|
@ -65,6 +66,7 @@ local apt_widget = wibox.widget {
|
||||||
|
|
||||||
--yaru-theme-sound/focal-updates,focal-updates 20.04.10.1 all [upgradable from: 20.04.8]
|
--yaru-theme-sound/focal-updates,focal-updates 20.04.10.1 all [upgradable from: 20.04.8]
|
||||||
local parse_package = function(line)
|
local parse_package = function(line)
|
||||||
|
--luacheck:ignore 211
|
||||||
local name,one,nv,type,ov = line:match('(.*)%/(.*)%s(.*)%s(.*)%s%[upgradable from: (.*)]')
|
local name,one,nv,type,ov = line:match('(.*)%/(.*)%s(.*)%s(.*)%s%[upgradable from: (.*)]')
|
||||||
|
|
||||||
if name == nil then return nil end
|
if name == nil then return nil end
|
||||||
|
@ -128,7 +130,6 @@ local function worker(user_args)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local i = 1
|
|
||||||
for line in containers:gmatch("[^\r\n]+") do
|
for line in containers:gmatch("[^\r\n]+") do
|
||||||
local package = parse_package(line)
|
local package = parse_package(line)
|
||||||
|
|
||||||
|
@ -230,7 +231,9 @@ local function worker(user_args)
|
||||||
self:get_children_by_id('name')[1]:set_opacity(0.4)
|
self:get_children_by_id('name')[1]:set_opacity(0.4)
|
||||||
self:get_children_by_id('name')[1]:emit_signal('widget::redraw_needed')
|
self:get_children_by_id('name')[1]:emit_signal('widget::redraw_needed')
|
||||||
|
|
||||||
spawn.easy_async(string.format([[sh -c 'yes | aptdcon --hide-terminal -u %s']], package['name']), function(stdout, stderr)
|
spawn.easy_async(
|
||||||
|
string.format([[sh -c 'yes | aptdcon --hide-terminal -u %s']], package['name']),
|
||||||
|
function(stdout, stderr) -- luacheck:ignore 212
|
||||||
rows:remove_widgets(self)
|
rows:remove_widgets(self)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -254,8 +257,6 @@ local function worker(user_args)
|
||||||
|
|
||||||
rows:add(row)
|
rows:add(row)
|
||||||
end
|
end
|
||||||
|
|
||||||
i = i + 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -285,6 +286,7 @@ local function worker(user_args)
|
||||||
widget = wibox.widget.imagebox
|
widget = wibox.widget.imagebox
|
||||||
}
|
}
|
||||||
header_refresh_icon:buttons(awful.util.table.join(awful.button({}, 1, function()
|
header_refresh_icon:buttons(awful.util.table.join(awful.button({}, 1, function()
|
||||||
|
-- luacheck:ignore 213
|
||||||
for i,v in pairs(to_update) do
|
for i,v in pairs(to_update) do
|
||||||
if v ~= nil then
|
if v ~= nil then
|
||||||
v:update()
|
v:update()
|
||||||
|
|
Loading…
Reference in New Issue