id | filename | status | |
driver | arduino.org | S | |
python_functions | arduino.py | STA | |
lisp_functions | arduino.lisp | T0 | inside string ends with ; |
function_enums | functions_enums.c | T | ends with, |
function_definitions | functions.c | T | function definitions |
function_names | function_names.c | T | ends with a coma |
function_PROGMEM | functions_PROGMEM.c | T | |
function_doc | function_doc.c | T | |
template | ulisp.tmpl | I | |
output | ulisp.ino | O | |
from string import Template
import os
exec(open("./arduino.py").read())
os.system('touch ulisp.ino')
fnames = dict_from_columns(0,1,inp)
fstatus = dict_from_columns(0,2,inp)
fstrings = {}
for i in list(fnames.keys()):fstrings[i] = read_file_to_string(fnames[i])
template_string = fstrings['template']
unquoted_lisp_code = fstrings['lisp_functions']
quoted_lisp_code = quote_lisp_library_text(unquoted_lisp_code)
fstrings['lisp_functions'] = quoted_lisp_code
template_string7 = template_string.format(**fstrings)
os.system('touch ulisp.ino')
write_string_to_file(fnames['output'],template_string7)
os.system('mv '+fnames['output']+ " " + "./ulisp/"+fnames['output'])
(defun read-file (infile)
(with-open-file (instream infile :direction :input :if-does-not-exist nil)
(when instream
(let ((string (make-string (file-length instream))))
(read-sequence string instream)
string))))
(setq funcs (read-file "functions.c"))
(format t "~a" funcs)