Skip to content
Snippets Groups Projects
Select Git revision
  • 63a7291f08d42c7e9cccde18e43b705ecf28450b
  • main default protected
  • feature/export-filtering
  • feature/clear-schedule-button
  • fix/responsive-cols-in-polls
  • feature/preference-polling-form
  • feature/json-export-via-rest-framework
  • feature/json-schedule-import-tests
  • fix/add-room-import-only-once
  • ak-import
  • renovate/django-simple-history-3.x
  • renovate/django-debug-toolbar-4.x
  • renovate/django-5.x
  • renovate/mysqlclient-2.x
14 results

0029_AK_notes.py

Blame
  • Forked from KIF / AKPlanning
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    debug.lua 1.14 KiB
    function eprintf(fmt, ...)
      minetest.log("info", fmt:format(...))
    end
    
    function table_print (tt, indent, done)
      done = done or {}
      indent = indent or 0
      if type(tt) == "table" then
        local sb = {}
        for key, value in pairs (tt) do
          table.insert(sb, string.rep (" ", indent)) -- indent it
          if type (value) == "table" and not done [value] then
            done [value] = true
            table.insert(sb, "{\n");
            table.insert(sb, table_print (value, indent + 2, done))
            table.insert(sb, string.rep (" ", indent)) -- indent it
            table.insert(sb, "}\n");
          elseif "number" == type(key) then
            table.insert(sb, string.format("\"%s\"\n", tostring(value)))
          else
            table.insert(sb, string.format(
                "%s = \"%s\"\n", tostring (key), tostring(value)))
           end
        end
        return table.concat(sb)
      else
        return tt .. "\n"
      end
    end
    
    function to_string( tbl )
        if  "nil"       == type( tbl ) then
            return tostring(nil)
        elseif  "table" == type( tbl ) then
            return table_print(tbl)
        elseif  "string" == type( tbl ) then
            return tbl
        else
            return tostring(tbl)
        end
    end