Compare commits
2 Commits
322439145e
...
a60fe6543e
Author | SHA1 | Date | |
---|---|---|---|
a60fe6543e | |||
dc32499ad7 |
@ -39,20 +39,6 @@
|
|||||||
*/
|
*/
|
||||||
static PyObject *p_module = NULL;
|
static PyObject *p_module = NULL;
|
||||||
|
|
||||||
static int check_file_exists(const char *path)
|
|
||||||
{
|
|
||||||
FILE *file;
|
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
file = fopen(path, "rb");
|
|
||||||
if (file) {
|
|
||||||
fclose(file);
|
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int FUNC_DECL(EXTERNAL_LIBRARY_RENDER_FUNCTION)(struct gds_cell *toplevel, GList *layer_info_list, const char *output_file_name, double scale)
|
int FUNC_DECL(EXTERNAL_LIBRARY_RENDER_FUNCTION)(struct gds_cell *toplevel, GList *layer_info_list, const char *output_file_name, double scale)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -112,11 +98,6 @@ int FUNC_DECL(EXTERNAL_LIBRARY_INIT_FUNCTION)(const char *params, const char *ve
|
|||||||
PyList_Append(p_sys_path, p_cwd_string);
|
PyList_Append(p_sys_path, p_cwd_string);
|
||||||
Py_DECREF(p_cwd_string);
|
Py_DECREF(p_cwd_string);
|
||||||
|
|
||||||
/* This renderer has only one parameter: The name of the file */
|
|
||||||
/*if (check_file_exists(params))
|
|
||||||
return -1001;
|
|
||||||
*/
|
|
||||||
|
|
||||||
p_name = PyUnicode_DecodeFSDefault(params);
|
p_name = PyUnicode_DecodeFSDefault(params);
|
||||||
p_module = PyImport_Import(p_name);
|
p_module = PyImport_Import(p_name);
|
||||||
Py_DECREF(p_name);
|
Py_DECREF(p_name);
|
||||||
@ -144,3 +125,5 @@ int FUNC_DECL(EXTERNAL_LIBRARY_FINALIZE_FUNCTION)(void)
|
|||||||
ret = Py_FinalizeEx();
|
ret = Py_FinalizeEx();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user