-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitiate.lua
More file actions
89 lines (65 loc) · 2.39 KB
/
initiate.lua
File metadata and controls
89 lines (65 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
--[[ LuaFAR context ]]--
----------------------------------------
--[[ description:
-- Work initiation.
-- Инициирование работы.
--]]
----------------------------------------
--[[ uses:
LuaFAR.
-- group: LF context.
--]]
--------------------------------------------------------------------------------
local _G = _G
--------------------------------------------------------------------------------
--local unit = {}
----------------------------------------
context = rawget(_G, 'context') or {}
local context = context
context.guid = "c0afe3a3-ff78-4904-b100-1c366d04ea96"
context.use = context.use or {} -- for non-context utils
---------------------------------------- Data
ctxdata = rawget(_G, 'ctxdata') or {}
local ctxdata = ctxdata
ctxdata.guid = "c05e4187-192b-4c37-8821-06cf75e7b4d1"
ctxdata.config = ctxdata.config or {} -- access to configs
ctxdata.reg = ctxdata.reg or {} -- register of configs
ctxdata.checked = ctxdata.checked or {} -- type checked configs
ctxdata.descriptors = ctxdata.descriptors or {} -- config descriptors
---------------------------------------- Debug
-- Show simple information.
function context.Show (...)
context.log = context.log or require "context.samples.logging"
return context.log.Show(...)
end ---- Show
-- Show required information.
function context.ShowInfo (...)
context.dbg = context.dbg or require "context.utils.useDebugs"
return context.dbg.Show(...)
end ---- ShowInfo
---------------------------------------- Config
local registerConfig
do -- Load special modules & Register types.
--far.Message("require configData")
require 'context.scripts.configData'
registerConfig = context.config.register
--far.Message("register 'types' config")
registerConfig{ key = 'types' }
--far.Message("require detectType")
require 'context.scripts.detectType'
end -- do
---------------------------------------- Configs
--do -- Register other configuration files.
--registerConfig{ key = 'key name', name = 'file base name' } -- Sample
--end
---------------------------------------- Modules
do
-- Modules loaded to context:
local modules = {
'context.scripts.handleType', --> detectType
'context.scripts.manageData',
} ---
-- Load modules to context.
for k = 1, #modules do require(modules[k]) end
end -- do
--------------------------------------------------------------------------------