manipulator modules working after detach/reattach

This commit is contained in:
kepler155c@gmail.com
2019-07-15 20:10:06 -06:00
parent ae20a8ada7
commit e4b1b50117
3 changed files with 7 additions and 4 deletions

View File

@@ -1,2 +1,3 @@
packages/common/ascii.lua urlfs http://pastebin.com/raw/u3kcnyjd
packages/common/hexedit.lua urlfs https://pastebin.com/raw/Ds9ajsp4
packages/common/colors.lua urlfs https://raw.githubusercontent.com/kepler155c/opus-apps/develop-1.8/ignore/colors.lua

View File

@@ -1,5 +1,4 @@
_G.requireInjector(_ENV)
local Util = require('util')
local Util = require('opus.util')
local colors = _G.colors
local term = _G.term

View File

@@ -67,7 +67,7 @@ function Storage:init()
Event.on({ 'device_attach', 'device_detach' }, function(e, dev)
_G._syslog('%s: %s', e, tostring(dev))
self:initStorage()
self:initStorage() -- this can yield - so we might miss events
end)
Event.onInterval(60, function()
self:showStorage()
@@ -111,6 +111,9 @@ function Storage:initStorage()
if v.mtype ~= 'hidden' then
if v.adapter then
v.adapter.online = not not device[k]
if v.adapter.online then
Util.merge(v.adapter, device[k])
end
elseif device[k] and device[k].list and device[k].size and device[k].pullItems then
if v.adapterType then
v.adapter = require(v.adapterType)({ side = k })