Rolled back on rev. 16039. Had problems with display, messages being blank and script...
authorIan Thompson <quornian@googlemail.com>
Tue, 12 Aug 2008 10:08:46 +0000 (10:08 +0000)
committerIan Thompson <quornian@googlemail.com>
Tue, 12 Aug 2008 10:08:46 +0000 (10:08 +0000)
1  2 
source/blender/python/BPY_extern.h
source/blender/python/BPY_interface.c
source/blender/src/drawtext.c

index a8b9cb48c16ea9e89915918f6f9dc038c93ae989,a8b9cb48c16ea9e89915918f6f9dc038c93ae989..3d9b45051fb453807811342225435a90b7a8cd06
@@@ -89,7 -89,7 +89,6 @@@ extern "C" 
        
        int BPY_Err_getLinenumber( void );
        const char *BPY_Err_getFilename( void );
--      const char *BPY_Err_getMessage( void );
  
        int BPY_txt_do_python_Text( struct Text *text );
        int BPY_menu_do_python( short menutype, int event );
index 635bdfe2d3c09a6f6b731eddadbdbfdf35824eab,635bdfe2d3c09a6f6b731eddadbdbfdf35824eab..05ea2d77ab919cae33ae8c8a0346d05f2d128a29
@@@ -145,11 -145,11 +145,9 @@@ static struct _inittab BPy_Inittab_Modu
  * Structure definitions       
  **************************************************************************/
  #define FILENAME_LENGTH 24
--#define MESSAGE_LENGTH 256
  
  typedef struct _ScriptError {
        char filename[FILENAME_LENGTH];
--      char message[MESSAGE_LENGTH+1];
        int lineno;
  } ScriptError;
  
@@@ -509,15 -509,15 +507,6 @@@ const char *BPY_Err_getFilename( void 
        return g_script_error.filename;
  }
  
--/*****************************************************************************/
--/* Description: This function will return the short message of the error     */
--/* that has occured in the python script.                                    */
--/*****************************************************************************/
--const char *BPY_Err_getMessage( void )
--{
--      return g_script_error.message;
--}
--
  /*****************************************************************************/
  /* Description: Return PyString filename from a traceback object          */
  /*****************************************************************************/
@@@ -577,15 -577,15 +566,6 @@@ void BPY_Err_Handle( char *script_name 
                } else {
                        g_script_error.lineno = -1;
                }
--              v = PyObject_GetAttrString( err, "text" );
--              if ( v && PyString_Check(v) ) {
--                      strcpy(g_script_error.message, "Invalid syntax: ");
--                      strncpy(g_script_error.message+16, PyString_AS_STRING( v ), MESSAGE_LENGTH-16);
--                      g_script_error.message[MESSAGE_LENGTH]= '\0';
--                      Py_DECREF( v );
--              } else {
--                      strcpy(g_script_error.message, "Invalid Syntax");
--              }
                /* this avoids an abort in Python 2.3's garbage collecting: */
                PyErr_Clear(  );
                return;
                                FILENAME_LENGTH );
                        Py_DECREF(v);
                }
--              v = PyObject_GetAttrString( err, "message" );
--              if ( v && PyString_Check(v) ) {
--                      strncpy(g_script_error.message, PyString_AS_STRING( v ), MESSAGE_LENGTH);
--                      g_script_error.message[MESSAGE_LENGTH]= '\0';
--                      Py_DECREF( v );
--              } else {
--                      g_script_error.message[0] = '\0';
--              }
                Py_DECREF( tb );
        }
  
index 80233c8295f47bfcf005c6fd35fef5fd9d710415,bc30a52f126ba281d802fc41c456531cc5a818ff..8647c3dde58cf2aa06e9990da3d465f0d7e1972c
@@@ -2036,18 -2014,18 +2036,6 @@@ void txt_find_panel(SpaceText *st, int 
        }
  }
  
--static void txt_print_error(SpaceText *st, char* str)
--{
--      if (curarea->spacetype != SPACE_TEXT) return;
--      drawtextspace(curarea, st);
--      glColor3ub(128, 16, 16);
--      glRecti(22, curarea->winy-2, curarea->winx-2, curarea->winy-st->lheight-3);
--      glColor3ub(255, 32, 32);
--      glRasterPos2i(22, curarea->winy-st->lheight);
--      BMF_DrawString(spacetext_get_font(st), str);
--      curarea->win_swap= WIN_BACK_OK;
--}
--
  void run_python_script(SpaceText *st)
  {
        char *py_filename;
                if (!st->text) return;
  
                if (!strcmp(py_filename, st->text->id.name+2)) {
--                      //error_pyscript(  );
++                      error_pyscript(  );
                        if (lineno >= 0) {
                                txt_move_toline(text, lineno-1, 0);
                                txt_sel_line(text);
                                pop_space_text(st);
--                      }
--                      txt_print_error(st, BPY_Err_getMessage());
++                      }       
                } else {
                        error("Error in other (possibly external) file, "\
                                "check console");
--              }
++              }       
        }
  }
  
@@@ -2907,6 -2875,6 +2894,7 @@@ void winqreadtextspace(ScrArea *sa, voi
                case PKEY:
                        if (G.qual == LR_ALTKEY) {
                                run_python_script(st);
++                              do_draw= 1;
                        }
                        break; /* BREAK P */
                case QKEY: