Blender V2.61 - r43446
|
#include <Python.h>
#include <stddef.h>
#include "bpy_internal_import.h"
#include "MEM_guardedalloc.h"
#include "DNA_text_types.h"
#include "BLI_listbase.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_text.h"
#include "BKE_main.h"
Go to the source code of this file.
Functions | |
void | bpy_import_init (PyObject *builtins) |
static void | free_compiled_text (Text *text) |
struct Main * | bpy_import_main_get (void) |
void | bpy_import_main_set (struct Main *maggie) |
void | bpy_text_filename_get (char *fn, size_t fn_len, Text *text) |
PyObject * | bpy_text_import (Text *text) |
PyObject * | bpy_text_import_name (const char *name, int *found) |
PyObject * | bpy_text_reimport (PyObject *module, int *found) |
static PyObject * | blender_import (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
static PyObject * | blender_reload (PyObject *UNUSED(self), PyObject *module) |
Variables | |
static Main * | bpy_import_main = NULL |
PyMethodDef | bpy_import_meth = {"bpy_import_meth", (PyCFunction)blender_import, METH_VARARGS | METH_KEYWORDS, "blenders import"} |
PyMethodDef | bpy_reload_meth = {"bpy_reload_meth", (PyCFunction)blender_reload, METH_O, "blenders reload"} |
This file defines replacements for pythons '__import__' and 'imp.reload' functions which can import from blender textblocks.
Definition in file bpy_internal_import.c.
static PyObject* blender_import | ( | PyObject * | UNUSEDself, |
PyObject * | args, | ||
PyObject * | kw | ||
) | [static] |
Definition at line 223 of file bpy_internal_import.c.
References bpy_text_import_name(), err, Main::name, and NULL.
static PyObject* blender_reload | ( | PyObject * | UNUSEDself, |
PyObject * | module | ||
) | [static] |
Definition at line 278 of file bpy_internal_import.c.
References bpy_text_reimport(), err, and NULL.
void bpy_import_init | ( | PyObject * | builtins | ) |
Definition at line 57 of file bpy_internal_import.c.
References BLI_assert, bpy_import_meth, bpy_reload_meth, mod(), and NULL.
Referenced by BPY_python_start().
struct Main* bpy_import_main_get | ( | void | ) | [read] |
Definition at line 85 of file bpy_internal_import.c.
References bpy_import_main.
Referenced by BPY_string_exec().
void bpy_import_main_set | ( | struct Main * | maggie | ) |
Definition at line 90 of file bpy_internal_import.c.
Referenced by bpy_context_clear(), bpy_context_update(), BPY_string_exec(), and pyop_call().
void bpy_text_filename_get | ( | char * | fn, |
size_t | fn_len, | ||
Text * | text | ||
) |
Definition at line 96 of file bpy_internal_import.c.
References BLI_snprintf(), Text::id, ID_BLEND_PATH, ID::name, and SEP.
Referenced by bpy_text_import(), and python_script_exec().
PyObject* bpy_text_import | ( | Text * | text | ) |
Definition at line 101 of file bpy_internal_import.c.
References BLI_strncpy(), bpy_text_filename_get(), Text::compiled, free_compiled_text(), Text::id, len(), MAX_ID_NAME, MEM_freeN(), ID::name, NULL, strlen(), and txt_to_buf().
Referenced by BPY_modules_load_user(), and bpy_text_import_name().
PyObject* bpy_text_import_name | ( | const char * | name, |
int * | found | ||
) |
Definition at line 130 of file bpy_internal_import.c.
References BLI_findstring(), bpy_import_main, bpy_text_import(), MAX_ID_NAME, NULL, strlen(), and Main::text.
Referenced by blender_import().
PyObject* bpy_text_reimport | ( | PyObject * | module, |
int * | found | ||
) |
Definition at line 166 of file bpy_internal_import.c.
References BLI_findstring(), BLI_path_basename(), bpy_import_main, Text::compiled, free_compiled_text(), Text::id, MEM_freeN(), Main::name, ID::name, NULL, Main::text, and txt_to_buf().
Referenced by blender_reload().
static void free_compiled_text | ( | Text * | text | ) | [static] |
Definition at line 77 of file bpy_internal_import.c.
References Text::compiled, and NULL.
Referenced by bpy_text_import(), and bpy_text_reimport().
Main* bpy_import_main = NULL [static] |
Definition at line 54 of file bpy_internal_import.c.
Referenced by bpy_import_main_get(), bpy_text_import_name(), and bpy_text_reimport().
PyMethodDef bpy_import_meth = {"bpy_import_meth", (PyCFunction)blender_import, METH_VARARGS | METH_KEYWORDS, "blenders import"} |
Definition at line 315 of file bpy_internal_import.c.
Referenced by bpy_import_init().
PyMethodDef bpy_reload_meth = {"bpy_reload_meth", (PyCFunction)blender_reload, METH_O, "blenders reload"} |
Definition at line 316 of file bpy_internal_import.c.
Referenced by bpy_import_init().