Fixed PythonInterpreter::interpretFile() so as to just use add_text()

instead of add_empty_text() plus file I/O code of its own.
This commit is contained in:
Tamito Kajiyama
2009-10-26 23:17:48 +00:00
parent a9a4dee0d0
commit d56a0fd72d

View File

@@ -72,16 +72,9 @@ class LIB_SYSTEM_EXPORT PythonInterpreter : public Interpreter
int status = BPY_run_python_script(_context, fn, NULL, reports);
#else
int status;
FILE *fp = fopen(fn, "r");
if (fp) {
struct Text *text = add_empty_text("tmp_freestyle.txt");
char buf[256];
while (fgets(buf, sizeof(buf), fp) != NULL)
txt_insert_buf(text, buf);
fclose(fp);
Text *text = add_text(fn, G.sce);
if (text) {
status = BPY_run_python_script(_context, NULL, text, reports);
unlink_text(G.main, text);
free_libblock(&G.main->text, text);
} else {