1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-20 02:07:39 +00:00

process improvements + new icons

This commit is contained in:
kepler155c@gmail.com
2017-09-27 15:42:40 -04:00
parent 4a608e11a2
commit 5969b71dbe
8 changed files with 113 additions and 44 deletions

View File

@@ -68,7 +68,7 @@ return function(args)
end
function selectFile.grid:draw()
local files = fs.list(self.dir, true)
local files = fs.listEx(self.dir)
if #self.dir > 0 then
table.insert(files, {
name = '..',

View File

@@ -82,16 +82,6 @@ function Util.getVersion()
return version or 1.7
end
function Util.runFunction(env, fn, ...)
setfenv(fn, env)
setmetatable(env, { __index = _G })
local args = { ... }
return pcall(function()
return fn(table.unpack(args))
end)
end
-- http://lua-users.org/wiki/SimpleRound
function Util.round(num, idp)
local mult = 10^(idp or 0)
@@ -360,7 +350,7 @@ function Util.loadTable(fname)
return s, m
end
--[[ URL functions ]] --
--[[ loading and running functions ]] --
function Util.download(url, filename)
local h = http.get(url)
if not h then
@@ -410,6 +400,14 @@ function Util.run(env, path, ...)
return fn, m
end
function Util.runFunction(env, fn, ...)
setfenv(fn, env)
setmetatable(env, { __index = _G })
local args = { ... }
return pcall(function() return fn(table.unpack(args)) end)
end
--[[ String functions ]] --
function Util.toBytes(n)
if n >= 1000000 or n <= -1000000 then