Remove awful.{spawn.,}pread (#184)
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
45d555d473
commit
2cfa117a14
|
@ -29,9 +29,9 @@ util.spawn_with_shell = function(...)
|
|||
return spawn.with_shell(...)
|
||||
end
|
||||
|
||||
util.pread = function(...)
|
||||
util.deprecate("awful.spawn.pread")
|
||||
return spawn.pread(...)
|
||||
util.pread = function()
|
||||
util.deprecate("Use io.popen() directly or look at awful.spawn.easy_async() "
|
||||
.. "for an asynchronous alternative")
|
||||
end
|
||||
|
||||
return
|
||||
|
|
|
@ -276,23 +276,6 @@ function spawn.read_lines(input_stream, line_callback, done_callback, close)
|
|||
start_read()
|
||||
end
|
||||
|
||||
--- Read a program output and return its output as a string.
|
||||
-- @tparam string cmd The command to run.
|
||||
-- @treturn string A string with the program output, or the error if one
|
||||
-- occured.
|
||||
function spawn.pread(cmd)
|
||||
if cmd and cmd ~= "" then
|
||||
local f, err = io.popen(cmd, 'r')
|
||||
if f then
|
||||
local s = f:read("*all")
|
||||
f:close()
|
||||
return s
|
||||
else
|
||||
return err
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
capi.awesome.connect_signal("spawn::canceled" , spawn.on_snid_cancel )
|
||||
capi.awesome.connect_signal("spawn::timeout" , spawn.on_snid_cancel )
|
||||
capi.client.connect_signal ("manage" , spawn.on_snid_callback )
|
||||
|
|
Loading…
Reference in New Issue