Replace improperly used asserts with warnings.

Add awful.spawn noop function to hooks.lua test. Previously it was nil.
This commit is contained in:
morethanoneanimal 2017-02-19 21:24:04 -08:00 committed by Yauhen Kirylau
parent a4b06bca58
commit 1c71260389
2 changed files with 5 additions and 3 deletions

View File

@ -125,6 +125,7 @@ local keygrabber = require("awful.keygrabber")
local util = require("awful.util")
local beautiful = require("beautiful")
local akey = require("awful.key")
local debug = require('gears.debug')
local prompt = {}
@ -518,10 +519,10 @@ function prompt.run(args, textbox, exe_callback, completion_callback,
hooks[key] = hooks[key] or {}
hooks[key][#hooks[key]+1] = v
else
assert("The hook's 3rd parameter has to be a function.")
debug.print_warning("The hook's 3rd parameter has to be a function.")
end
else
assert("The hook has to have 3 parameters.")
debug.print_warning("The hook has to have 3 parameters.")
end
end

View File

@ -1,7 +1,8 @@
local parent = ... --DOC_NO_USAGE --DOC_HIDE
local wibox = require( "wibox" ) --DOC_HIDE
local awful = { prompt = require("awful.prompt"),--DOC_HIDE
util = require("awful.util")}--DOC_HIDE
util = require("awful.util"), --DOC_HIDE
spawn = function () end } --DOC_HIDE
local beautiful = require( "beautiful" ) --DOC_HIDE
local atextbox = wibox.widget.textbox()