Merge pull request #454 from psychon/remove_gears.debug.assert
Remove gears.debug.assert Closes https://github.com/awesomeWM/awesome/pull/454. Conflicts: lib/gears/matrix.lua
This commit is contained in:
commit
28ffdb050e
|
@ -14,17 +14,6 @@ local pairs = pairs
|
||||||
|
|
||||||
local debug = {}
|
local debug = {}
|
||||||
|
|
||||||
--- Check that the given condition holds true, else throw an error
|
|
||||||
--
|
|
||||||
-- @param cond If this is false, throw a lua error with a backtrace.
|
|
||||||
-- @param[opt] message Message to print in the error.
|
|
||||||
function debug.assert(cond, message)
|
|
||||||
local message = message or cond
|
|
||||||
if not cond then
|
|
||||||
error(traceback("Assertion failed: '" .. tostring(message) .. "'"))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Given a table (or any other data) return a string that contains its
|
--- Given a table (or any other data) return a string that contains its
|
||||||
-- tag, value and type. If data is a table then recursively call `dump_raw`
|
-- tag, value and type. If data is a table then recursively call `dump_raw`
|
||||||
-- on each of its values.
|
-- on each of its values.
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
local cairo = require("lgi").cairo
|
local cairo = require("lgi").cairo
|
||||||
local debug = require("gears.debug")
|
|
||||||
local matrix = {}
|
local matrix = {}
|
||||||
|
|
||||||
-- Metatable for matrix instances. This is set up near the end of the file.
|
-- Metatable for matrix instances. This is set up near the end of the file.
|
||||||
|
|
|
@ -15,7 +15,6 @@ local capi = {
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
local cairo = require("lgi").cairo
|
local cairo = require("lgi").cairo
|
||||||
local color = require("gears.color")
|
local color = require("gears.color")
|
||||||
local debug = require("gears.debug")
|
|
||||||
local object = require("gears.object")
|
local object = require("gears.object")
|
||||||
local sort = require("gears.sort")
|
local sort = require("gears.sort")
|
||||||
local surface = require("gears.surface")
|
local surface = require("gears.surface")
|
||||||
|
@ -133,7 +132,7 @@ local function do_redraw(self)
|
||||||
|
|
||||||
self.drawable:refresh()
|
self.drawable:refresh()
|
||||||
|
|
||||||
debug.assert(cr.status == "SUCCESS", "Cairo context entered error state: " .. cr.status)
|
assert(cr.status == "SUCCESS", "Cairo context entered error state: " .. cr.status)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function find_widgets(drawable, result, hierarchy, x, y)
|
local function find_widgets(drawable, result, hierarchy, x, y)
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
-- @module wibox.widget.base
|
-- @module wibox.widget.base
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
local debug = require("gears.debug")
|
|
||||||
local object = require("gears.object")
|
local object = require("gears.object")
|
||||||
local cache = require("gears.cache")
|
local cache = require("gears.cache")
|
||||||
local matrix = require("gears.matrix")
|
local matrix = require("gears.matrix")
|
||||||
|
@ -423,9 +422,9 @@ end
|
||||||
--- Do some sanity checking on widget. This function raises a lua error if
|
--- Do some sanity checking on widget. This function raises a lua error if
|
||||||
-- widget is not a valid widget.
|
-- widget is not a valid widget.
|
||||||
function base.check_widget(widget)
|
function base.check_widget(widget)
|
||||||
debug.assert(type(widget) == "table")
|
assert(type(widget) == "table")
|
||||||
for k, func in pairs({ "add_signal", "connect_signal", "disconnect_signal" }) do
|
for k, func in pairs({ "add_signal", "connect_signal", "disconnect_signal" }) do
|
||||||
debug.assert(type(widget[func]) == "function", func .. " is not a function")
|
assert(type(widget[func]) == "function", func .. " is not a function")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue