5.7 Example scripts
191
When showing a configuration to the user, we display not only its
name, but also its modification date. This makes it easier for the user to
identify the configuration:
-- config selection
files, msg = os.listdir(
configs,false)
if not files then files = {} end
if #files > 0 then
table.sort(files)
local i = 1
while i <= #files do
if files[i] == config_name then
break
end
i = i + 1
end
while true do
if i <= 0 then
i = #files
elseif i > #files then
i = 1
end
cls()
print("Press SET to select")
print("LEFT/RIGHT to scroll")
print("DISP to abort")
local fstat = os.stat(
configs.."/"..files[i])
local mdate = fstat.mtime
local s = os.date("%c", mdate)
print("Switch to: "..
files[i].." ("..s..")")
wait_click(5000)
if is_pressed("set") then
selected_config = files[i]
break
elseif
is_pressed("display") then
break
elseif is_pressed("left") then
i = i - 1
elseif
is_pressed("right") then
Содержание Camera
Страница 1: ......
Страница 2: ...The Canon Camera Hackers Manual ...
Страница 3: ......
Страница 4: ...Berthold Daum The Canon Camera Hackers Manual Teach Your Camera New Tricks ...
Страница 19: ...10 CH APTER 2 Cameras and Operating Systems ...
Страница 25: ...16 CH APTER 3 ...
Страница 85: ...76 CH APTER 4 Teach Your Camera New Tricks ...
Страница 213: ...204 CH APTER 6 ...
Страница 253: ...244 AP PENDIX ...