rename and negate DISABLE_PYTHON --> WITH_PYTHON
[blender.git] / source / blender / editors / space_script / script_edit.c
index fe5ecd10eb118fd464125d8b5682857878c08474..b9ece0add2fd2dfc578f077907306dda022588eb 100644 (file)
@@ -30,7 +30,6 @@
 #include <stdio.h>
 
 
-#include "MEM_guardedalloc.h"
 
 #include "BLI_blenlib.h"
 
@@ -47,7 +46,7 @@
 
 #include "script_intern.h"     // own include
 
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
 #include "BPY_extern.h" /* BPY_run_python_script */
 #endif
 
@@ -55,12 +54,14 @@ static int run_pyfile_exec(bContext *C, wmOperator *op)
 {
        char path[512];
        RNA_string_get(op->ptr, "filepath", path);
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
        if(BPY_run_python_script(C, path, NULL, op->reports)) {
                ARegion *ar= CTX_wm_region(C);
                ED_region_tag_redraw(ar);
                return OPERATOR_FINISHED;
        }
+#else
+       (void)C; /* unused */
 #endif
        return OPERATOR_CANCELLED; /* FAIL */
 }
@@ -81,15 +82,17 @@ void SCRIPT_OT_python_file_run(wmOperatorType *ot)
 }
 
 
-static int script_reload_exec(bContext *C, wmOperator *op)
+static int script_reload_exec(bContext *C, wmOperator *UNUSED(op))
 {
-#ifndef DISABLE_PYTHON
+#ifdef WITH_PYTHON
        /* TODO, this crashes on netrender and keying sets, need to look into why
         * disable for now unless running in debug mode */
        WM_cursor_wait(1);
        BPY_eval_string(C, "__import__('bpy').utils.load_scripts(reload_scripts=True)");
        WM_cursor_wait(0);
        return OPERATOR_FINISHED;
+#else
+       (void)C; /* unused */
 #endif
        return OPERATOR_CANCELLED;
 }