Last active
December 3, 2018 19:45
-
-
Save leeonix/700333e9c4fc0574ec7b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: gbk | |
<%! | |
from textwrap import wrap | |
%> | |
local ${machine.name} = require '${machine.name}' | |
local delegate = {} | |
-------------------------------------------------------------------------------- | |
-- input | |
% for i in machine.inputs: | |
%if i.comment: | |
%for l in wrap(i.comment, 80): | |
-- ${l} | |
%endfor | |
%endif | |
function delegate.${i.name}(param) | |
return false | |
end -- end function | |
% endfor | |
-------------------------------------------------------------------------------- | |
-- output | |
% for o in machine.outputs: | |
%if o.comment: | |
% for l in wrap(o.comment, 80): | |
-- ${l} | |
% endfor | |
% endif | |
function delegate.${o.name}(param) | |
end -- end function | |
% endfor | |
${machine.name}.set_delegate(delegate) | |
return ${machine.name} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment