Mercurial > wow > breuesk
comparison Lists.lua @ 39:ecef0cba2913
Very handy - print the public api of an object. Nice for when you get an AceGUI object (etc) and don't know what it exposes
author | John@Doomsday |
---|---|
date | Wed, 14 Mar 2012 10:13:30 -0400 |
parents | 6362fe301d43 |
children | dc9bfacca238 |
comparison
equal
deleted
inserted
replaced
38:7bfbff27a3d7 | 39:ecef0cba2913 |
---|---|
124 function bsk:PrintChanges() | 124 function bsk:PrintChanges() |
125 bsk:PrintTable(bsk.db.profile.changes) | 125 bsk:PrintTable(bsk.db.profile.changes) |
126 end | 126 end |
127 function bsk:PrintPersons() | 127 function bsk:PrintPersons() |
128 bsk:PrintTable(bsk.persons) | 128 bsk:PrintTable(bsk.persons) |
129 end | |
130 function bsk:PrintAPI(object) | |
131 for i,v in pairs(object) do | |
132 if type(v) == "function" then | |
133 bsk:Print("function "..i.."()") | |
134 end | |
135 end | |
129 end | 136 end |
130 function bsk:PrintTable(table, depth) | 137 function bsk:PrintTable(table, depth) |
131 depth = depth or "" | 138 depth = depth or "" |
132 if not table then return end | 139 if not table then return end |
133 if #depth > 3*5 then self:Print(depth.."Recursion too deep - stopping"); return end | 140 if #depth > 3*5 then self:Print(depth.."Recursion too deep - stopping"); return end |