re-add format parameter.
This broke custom formats in the date widget.
This commit is contained in:
parent
750532a1d8
commit
1cfa040fbd
7
init.lua
7
init.lua
|
@ -76,7 +76,7 @@ local function update(widget, reg, disablecache)
|
|||
cache.time, cache.data = t, data
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Check for cached output newer than the last update
|
||||
local c = widget_cache[reg.wtype]
|
||||
if c and c.time and c.data and t < c.time+reg.timer and not disablecache then
|
||||
|
@ -85,14 +85,15 @@ local function update(widget, reg, disablecache)
|
|||
if reg.wtype.async then
|
||||
if not reg.lock then
|
||||
reg.lock = true
|
||||
return reg.wtype.async(reg.warg,
|
||||
return reg.wtype.async(reg.format,
|
||||
reg.warg,
|
||||
function(data)
|
||||
update_value(format_data(data), t, c)
|
||||
reg.lock=false
|
||||
end)
|
||||
end
|
||||
else
|
||||
return update_value(format_data(reg.wtype(nil, reg.warg)), t, c)
|
||||
return update_value(format_data(reg.wtype(reg.format, reg.warg)), t, c)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,7 +17,7 @@ local pkg_all = {}
|
|||
|
||||
|
||||
-- {{{ Packages widget type
|
||||
function pkg_all.async(warg, callback)
|
||||
function pkg_all.async(format, warg, callback)
|
||||
if not warg then return end
|
||||
|
||||
-- Initialize counters
|
||||
|
@ -44,7 +44,7 @@ function pkg_all.async(warg, callback)
|
|||
size = math.max(size-first, 0)
|
||||
return {size, lines}
|
||||
end
|
||||
|
||||
|
||||
-- Select command
|
||||
local _pkg = manager[warg]
|
||||
spawn.easy_async(_pkg.cmd, function(stdout) callback(parse(stdout, _pkg.sub)) end)
|
||||
|
@ -54,8 +54,8 @@ end
|
|||
-- {{{ Packages widget type
|
||||
local function worker(format, warg)
|
||||
local ret = nil
|
||||
|
||||
pkg_all.async(warg, function(data) ret = data end)
|
||||
|
||||
pkg_all.async(format, warg, function(data) ret = data end)
|
||||
|
||||
while ret==nil do end
|
||||
return ret
|
||||
|
|
Loading…
Reference in New Issue