lint warnings

This commit is contained in:
kepler155c@gmail.com
2019-07-21 10:17:30 -06:00
parent a48bd364fd
commit 96e8d7e7cd
3 changed files with 17 additions and 9 deletions

View File

@@ -4,7 +4,6 @@ local Util = require('opus.util')
local UI = require('opus.ui')
local Event = require('opus.event')
local args = { ... }
local colors = _G.colors
local fs = _G.fs
local gps = _G.gps
@@ -24,7 +23,7 @@ local STARTUP_FILE = 'usr/autorun/gpsServer.lua'
local positions = { }
UI:configure('gps', ...)
local args, options = Util.parse( ... )
local args = Util.parse( ... )
local page = UI.Page {
menuBar = UI.MenuBar {
@@ -60,7 +59,9 @@ function page.grid:getDisplayValues(row)
end
function page.grid:getRowTextColor(row, selected)
return row.changed and colors.yellow or not row.alive and colors.lightGray or UI.Grid.getRowTextColor(self, row, selected)
return row.changed and colors.yellow or
not row.alive and colors.lightGray or
UI.Grid.getRowTextColor(self, row, selected)
end
function page.menuBar:eventHandler(event)
@@ -71,7 +72,7 @@ function page.menuBar:eventHandler(event)
end
end
elseif event.type == 'clear_all' then
for id, detail in pairs(positions) do
for id in pairs(positions) do
positions[id] = nil
end
else return UI.MenuBar.eventHandler(self, event)
@@ -251,7 +252,7 @@ local function server(mode)
end
end
Event.on('modem_message', function(e, side, channel, computerId, message, distance)
Event.on('modem_message', function(_, side, channel, computerId, message, distance)
if distance and modems[side] then
if mode == 'gps' and channel == gps.CHANNEL_GPS and message == "PING" then
for _, modem in pairs(modems) do
@@ -268,7 +269,7 @@ local function server(mode)
Event.onInterval(1, function()
local resync = false
for id, detail in pairs(positions) do
for _, detail in pairs(positions) do
if os.clock() - detail.lastChanged > 10 then
detail.changed = false
resync = true

View File

@@ -115,12 +115,14 @@ local function createPage(node)
},
storage = UI.ProgressBar {
x = 2, ex = -2, y = 7, height = 3,
progressChar = ' ',
},
unlockedLabel = UI.Text {
x = 2, ex = -1, y = 12,
},
unlocked = UI.ProgressBar {
x = 2, ex = -2, y = 13, height = 3,
progressChar = ' ',
},
craftingLabel = UI.Text {
x = 2, ex = -1, y = 18,
@@ -128,6 +130,7 @@ local function createPage(node)
},
crafting = UI.ProgressBar {
x = 2, ex = -2, y = 19, height = 3,
progressChar = ' ',
value = 100,
},
},

View File

@@ -3,8 +3,12 @@ local Util = require('opus.util')
local Event = require('opus.event')
local Config = require('opus.config')
local colors = _G.colors
local fs = _G.fs
UI:configure('Shoplogs', ...)
local args, options = Util.parse( ... )
local args = Util.parse( ... )
local logFile = args[1] or '/usr/swshop.log'
local config = Config.load('Shoplogs', {
timezone = 0,
@@ -100,7 +104,7 @@ function page.menuBar:eventHandler(event)
page.grid.values = {}
page.grid:update()
page.grid:draw()
fs.delete(args[1])
fs.delete(logFile)
elseif event.type == "set_timezone" then
page.tzSlide:show()
@@ -146,7 +150,7 @@ function page.grid:addTransaction(transaction)
end
function page.grid:loadTransactions()
local logs = Util.readTable(args[1]) or {}
local logs = Util.readTable(logFile) or {}
self:setValues(logs)
self:update()
end