Make the output of the gears.object.signal example stable (#1703)

Previously it would print a table which would include the memory
location where the table was stored. Thus, this produces a different
result on every build.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2017-04-08 10:00:34 +02:00 committed by Daniel Hahler
parent 2b1c99c2a6
commit b3635a0101
1 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,11 @@ local gears = require("gears") --DOC_HIDE
local o = gears.object{}
-- Add a __tostring metamethod for prettier output --DOC_HIDE
getmetatable(o).__tostring = function() --DOC_HIDE
return "[obj]" --DOC_HIDE
end --DOC_HIDE
-- Function can be attached to signals
local function slot(obj, a, b, c)
print("In slot", obj, a, b, c)