webmcp
diff framework/env/__init.lua @ 203:c6ef9991b911
Removed CGI support; Created draft for new MCP program to be used with "Moonbridge Network Server for Lua Applications"
author | jbe |
---|---|
date | Fri Jan 09 01:57:20 2015 +0100 (2015-01-09) |
parents | 9fdfb27f8e67 |
children | eb3e236d261d |
line diff
1.1 --- a/framework/env/__init.lua Mon Aug 25 20:00:01 2014 +0200 1.2 +++ b/framework/env/__init.lua Fri Jan 09 01:57:20 2015 +0100 1.3 @@ -1,3 +1,4 @@ 1.4 +-- string localization function 1.5 function _(text, replacements) 1.6 local text = locale._get_translation_table()[text] or text 1.7 if replacements then 1.8 @@ -14,3 +15,35 @@ 1.9 return text 1.10 end 1.11 end 1.12 + 1.13 +--[[-- 1.14 +cloned_table = -- newly generated table 1.15 +table.new( 1.16 + table_or_nil -- keys of a given table will be copied to the new table 1.17 +) 1.18 + 1.19 +If a table is given, then a cloned table is returned. 1.20 +If nil is given, then a new empty table is returned. 1.21 + 1.22 +--]]-- 1.23 +function table.new(tbl) 1.24 + new_tbl = {} 1.25 + if tbl then 1.26 + for key, value in pairs(tbl) do 1.27 + new_tbl[key] = value 1.28 + end 1.29 + end 1.30 + return new_tbl 1.31 +end 1.32 +--//-- 1.33 + 1.34 +-- load libraries 1.35 +extos = require 'extos' 1.36 +nihil = require 'nihil' 1.37 +multirand = require 'multirand' 1.38 +mondelefant = require 'mondelefant' 1.39 +mondelefant.connection_prototype.error_objects = true 1.40 +atom = require 'atom' 1.41 +json = require 'json' 1.42 +require 'mondelefant_atom_connector' 1.43 +