mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -04:00
Merge branch 'master-MC1.8.9' of github.com:MightyPirates/OpenComputers into master-MC1.9.4
This commit is contained in:
commit
87d3567abf
@ -291,7 +291,7 @@ local function test(m,p)
|
|||||||
write("\n")
|
write("\n")
|
||||||
empty_line = true
|
empty_line = true
|
||||||
needs_filename, needs_line_num = include_filename, print_line_num
|
needs_filename, needs_line_num = include_filename, print_line_num
|
||||||
elseif p:find("^^") then break end
|
elseif p:find("^^") and not plain then p="^$" end
|
||||||
end
|
end
|
||||||
if not empty_line then write("\n") end
|
if not empty_line then write("\n") end
|
||||||
end
|
end
|
||||||
|
@ -1,8 +1,20 @@
|
|||||||
require("filesystem").mount(
|
require("filesystem").mount(
|
||||||
setmetatable({
|
setmetatable({
|
||||||
isReadOnly = function()return false end,
|
address = "f5501a9b-9c23-1e7a-4afe-4b65eed9b88a"
|
||||||
address = require("uuid").next()
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
__index=function(tbl,key)return require("devfs")[key]end
|
__index=function(tbl,key)
|
||||||
|
local pass
|
||||||
|
local passthrough = function() return pass end
|
||||||
|
if key == "getLabel" then
|
||||||
|
pass = "devfs"
|
||||||
|
elseif key == "spaceTotal" or key == "spaceUsed" then
|
||||||
|
pass = 0
|
||||||
|
elseif key == "isReadOnly" then
|
||||||
|
pass = false
|
||||||
|
else
|
||||||
|
return require("devfs")[key]
|
||||||
|
end
|
||||||
|
return passthrough
|
||||||
|
end
|
||||||
}), "/dev")
|
}), "/dev")
|
||||||
|
@ -191,22 +191,10 @@ local devfs = new_devfs_dir()
|
|||||||
|
|
||||||
local bfd = "bad file descriptor"
|
local bfd = "bad file descriptor"
|
||||||
|
|
||||||
function devfs.getLabel()
|
|
||||||
return "devfs"
|
|
||||||
end
|
|
||||||
|
|
||||||
function devfs.setLabel(value)
|
function devfs.setLabel(value)
|
||||||
error("drive does not support labeling")
|
error("drive does not support labeling")
|
||||||
end
|
end
|
||||||
|
|
||||||
function devfs.spaceTotal()
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
|
|
||||||
function devfs.spaceUsed()
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
|
|
||||||
function devfs.makeDirectory(path)
|
function devfs.makeDirectory(path)
|
||||||
return false, "to create dirs in devfs use devfs.create"
|
return false, "to create dirs in devfs use devfs.create"
|
||||||
end
|
end
|
||||||
@ -284,9 +272,7 @@ end
|
|||||||
|
|
||||||
devfs.create("null", devfs_load("null"))
|
devfs.create("null", devfs_load("null"))
|
||||||
devfs.create("random", devfs_load("random"))
|
devfs.create("random", devfs_load("random"))
|
||||||
if comp.isAvailable("eeprom") then
|
devfs.create("eeprom", devfs_load("eeprom"))
|
||||||
devfs.create("eeprom", devfs_load("eeprom"))
|
devfs.create("eeprom-data", devfs_load("eeprom-data"))
|
||||||
devfs.create("eeprom-data", devfs_load("eeprom-data"))
|
|
||||||
end
|
|
||||||
|
|
||||||
return devfs
|
return devfs
|
||||||
|
@ -261,7 +261,7 @@ function term.readKeyboard(ops)
|
|||||||
if name == "touch" or name == "drag" then
|
if name == "touch" or name == "drag" then
|
||||||
term.internal.onTouch(input,char,code)
|
term.internal.onTouch(input,char,code)
|
||||||
elseif name == "clipboard" then
|
elseif name == "clipboard" then
|
||||||
c = char
|
c = term.internal.clipboard(char)
|
||||||
hints.cache = nil
|
hints.cache = nil
|
||||||
elseif name == "key_down" then
|
elseif name == "key_down" then
|
||||||
hints.cache = nil
|
hints.cache = nil
|
||||||
@ -634,4 +634,17 @@ function --[[@delayloaded-start@]] term.getGlobalArea(window)
|
|||||||
return dx+1,dy+1,w,h
|
return dx+1,dy+1,w,h
|
||||||
end --[[@delayloaded-end@]]
|
end --[[@delayloaded-end@]]
|
||||||
|
|
||||||
|
function --[[@delayloaded-start@]] term.internal.clipboard(char)
|
||||||
|
local first_line, end_index = char:find("\13?\10")
|
||||||
|
if first_line then
|
||||||
|
local after = char:sub(end_index + 1)
|
||||||
|
if after ~= "" then
|
||||||
|
require("computer").pushSignal("key_down", term.keyboard(), 13, 28)
|
||||||
|
require("computer").pushSignal("clipboard", term.keyboard(), after)
|
||||||
|
end
|
||||||
|
char = char:sub(1, first_line - 1)
|
||||||
|
end
|
||||||
|
return char
|
||||||
|
end --[[@delayloaded-end@]]
|
||||||
|
|
||||||
return term, local_env
|
return term, local_env
|
||||||
|
@ -334,7 +334,7 @@ function --[[@delayloaded-start@]] text.internal.reader(txt)
|
|||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
return reader
|
return require("buffer").new("r", reader)
|
||||||
end --[[@delayloaded-end@]]
|
end --[[@delayloaded-end@]]
|
||||||
|
|
||||||
function --[[@delayloaded-start@]] text.internal.writer(ostream, append_txt)
|
function --[[@delayloaded-start@]] text.internal.writer(ostream, append_txt)
|
||||||
@ -374,7 +374,7 @@ function --[[@delayloaded-start@]] text.internal.writer(ostream, append_txt)
|
|||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
return writer
|
return require("buffer").new("w", writer)
|
||||||
end --[[@delayloaded-end@]]
|
end --[[@delayloaded-end@]]
|
||||||
|
|
||||||
return text, local_env
|
return text, local_env
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
local comp = require("component")
|
local comp = require("component")
|
||||||
local text = require("text")
|
local text = require("text")
|
||||||
|
|
||||||
if not comp.isAvailable("eeprom") then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
return
|
return
|
||||||
{
|
{
|
||||||
open = function(mode)
|
open = function(mode)
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
local comp = require("component")
|
local comp = require("component")
|
||||||
local text = require("text")
|
local text = require("text")
|
||||||
|
|
||||||
if not comp.isAvailable("eeprom") then
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
return
|
return
|
||||||
{
|
{
|
||||||
open = function(mode)
|
open = function(mode)
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
return
|
return
|
||||||
{
|
{
|
||||||
open = function(mode)
|
open = function(mode)
|
||||||
if not mode or not mode:match("[wa]") then
|
|
||||||
return nil, "write only"
|
|
||||||
end
|
|
||||||
return
|
return
|
||||||
{
|
{
|
||||||
|
read = function() end,
|
||||||
write = function() end
|
write = function() end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user