Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-07-09 11:35:35 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-07-09 11:35:35 +0400
commit1fd38701e99e2b3087c949bd00de71085cde02aa (patch)
tree2e3653188f7343254ba79cac0d9de4b889379aaf /source/blender/python/intern/bpy_interface.c
parentd7a333f83fcaa33a73304c8bbff7c0809ada9aa0 (diff)
removed check for pyc when scanning the directory of python files.
Brecht, double checked and pyc or pyo files arent used because of the (file_extension[3] == '\0') test.
Diffstat (limited to 'source/blender/python/intern/bpy_interface.c')
-rw-r--r--source/blender/python/intern/bpy_interface.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 64f2d896954..76c27dbbc22 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -453,7 +453,7 @@ void BPY_run_ui_scripts(bContext *C, int reload)
char *dirname;
char path[FILE_MAX];
char *dirs[] = {"io", "ui", NULL};
- int a, filelen; /* filename length */
+ int a;
PyGILState_STATE gilstate;
PyObject *mod;
@@ -490,15 +490,10 @@ void BPY_run_ui_scripts(bContext *C, int reload)
/* We could stat the file but easier just to let python
* import it and complain if theres a problem */
- if(strstr(de->d_name, ".pyc"))
- continue;
-
file_extension = strstr(de->d_name, ".py");
- if(file_extension && *(file_extension + 3) == '\0') {
- filelen = strlen(de->d_name);
- BLI_strncpy(path, de->d_name, filelen-2); /* cut off the .py on copy */
-
+ if(file_extension && file_extension[3] == '\0') {
+ BLI_strncpy(path, de->d_name, (file_extension - de->d_name) + 1); /* cut off the .py on copy */
mod= PyImport_ImportModuleLevel(path, NULL, NULL, NULL, 0);
if (mod) {
if (reload) {
@@ -511,7 +506,7 @@ void BPY_run_ui_scripts(bContext *C, int reload)
if(mod) {
Py_DECREF(mod); /* could be NULL from reloading */
} else {
- BPy_errors_to_report(NULL); // TODO - reports
+ BPy_errors_to_report(NULL);
fprintf(stderr, "unable to import \"%s\" %s/%s\n", path, dirname, de->d_name);
}