Revision: 21935
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21935
Author:   campbellbarton
Date:     2009-07-26 20:56:27 +0200 (Sun, 26 Jul 2009)

Log Message:
-----------
indentation error with some operators (strip the descriptions)
if 0'd the exec() workaround for running python scripts incase windows devs 
want to test.

theeth said the problem is when you compile a debug blender against a non debug 
python (or the ther way I assume), you can get a FILE struct mismatch.

A quick way to test this on windows is to run this from the command line.
 blender -P somescript.py
 
Somescript.py can be anything

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/python/epy_doc_gen.py
    branches/blender2.5/blender/source/blender/python/intern/bpy_interface.c

Modified: branches/blender2.5/blender/source/blender/python/epy_doc_gen.py
===================================================================
--- branches/blender2.5/blender/source/blender/python/epy_doc_gen.py    
2009-07-26 18:52:27 UTC (rev 21934)
+++ branches/blender2.5/blender/source/blender/python/epy_doc_gen.py    
2009-07-26 18:56:27 UTC (rev 21935)
@@ -69,11 +69,11 @@
        # Operators and functions work differently
        if func_type=='OPERATOR':
                rna_func_name = rna_struct.identifier
-               rna_func_desc = rna_struct.description
+               rna_func_desc = rna_struct.description.strip()
                items = rna_struct.properties.items()
        else:
                rna_func_name = rna.identifier
-               rna_func_desc = rna.description
+               rna_func_desc = rna.description.strip()
                items = rna.parameters.items()
        
        for rna_prop_identifier, rna_prop in items:
@@ -94,7 +94,7 @@
                array_str = get_array_str(length)
                
                kw_type_str= "@type %s: %s%s" % (rna_prop_identifier, 
rna_prop_type, array_str)
-               kw_param_str= "@param %s: %s" % (rna_prop_identifier, 
rna_prop.description)
+               kw_param_str= "@param %s: %s" % (rna_prop_identifier, 
rna_prop.description.strip())
                kw_param_set = False
                
                if func_type=='OPERATOR':
@@ -205,7 +205,7 @@
                out.write(ident+ '\t"""\n')
                
                title = 'The %s Object' % rna_struct.name
-               description = rna_struct.description
+               description = rna_struct.description.strip()
                out.write(ident+ '\t%s\n' %  title)
                out.write(ident+ '\t%s\n' %  ('=' * len(title)))
                out.write(ident+ '\t\t%s\n' %  description)
@@ -238,7 +238,7 @@
                        if rna_prop_identifier=='rna_type':
                                continue
                        
-                       rna_desc = rna_prop.description
+                       rna_desc = rna_prop.description.strip()
                        
                        if rna_desc: rna_words.update(rna_desc.split())
                        if not rna_desc: rna_desc = rna_prop.name

Modified: 
branches/blender2.5/blender/source/blender/python/intern/bpy_interface.c
===================================================================
--- branches/blender2.5/blender/source/blender/python/intern/bpy_interface.c    
2009-07-26 18:52:27 UTC (rev 21934)
+++ branches/blender2.5/blender/source/blender/python/intern/bpy_interface.c    
2009-07-26 18:56:27 UTC (rev 21935)
@@ -260,6 +260,14 @@
                py_result =  PyEval_EvalCode( text->compiled, py_dict, py_dict 
);
                
        } else {
+#if 0
+               char *pystring;
+               pystring= malloc(strlen(fn) + 32);
+               pystring[0]= '\0';
+               sprintf(pystring, "exec(open(r'%s').read())", fn);
+               py_result = PyRun_String( pystring, Py_file_input, py_dict, 
py_dict );
+               free(pystring);
+#else
                FILE *fp= fopen(fn, "r");               
                if(fp) {
                        py_result = PyRun_File(fp, fn, Py_file_input, py_dict, 
py_dict);
@@ -269,7 +277,7 @@
                        PyErr_Format(PyExc_SystemError, "Python file \"%s\" 
could not be opened: %s", fn, strerror(errno));
                        py_result= NULL;
                }
-               
+#endif
        }
        
        if (!py_result) {


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to