Page MenuHome

Add support for catching python stdin/out
Needs ReviewPublic

Authored by Mateusz Grzeliński (grzelins) on Jul 2 2020, 3:05 PM.

Details

Summary

Python evaluation logs will be printed as info report. There will be one entry for python output (stdout, stderr) and one for error (if occured). There will be no need to look at the console.

There are small issues left, but this is the core is done.
Possible issues:

  • should there be an option in text editor for catching python output?
  • iowrapper can be moved to bpy_cap_utils.c
  • iowrapper can be converted to use struct instead of globals
  • python print is visible only in console as log bke.report only in level INFO (default is warning) blender --log-severity 2 --log "bke.report"
INFO (bke.report): /home/mat/CLionProjects/blender-copy/blender-src/source/blender/blenkernel/intern/report.c:136 BKE_report_format: ReportList(0x60b0002811f8):Info: Python output from "/Text":
blah

Diff Detail

Repository
rB Blender
Branch
show-python-eval-logs (branched from master)
Build Status
Buildable 8798
Build 8798: arc lint + arc unit

Event Timeline

Mateusz Grzeliński (grzelins) requested review of this revision.Jul 2 2020, 3:05 PM
Mateusz Grzeliński (grzelins) created this revision.
Mateusz Grzeliński (grzelins) retitled this revision from Add experimental support for catching python stdin/out to WIP: Add experimental support for catching python stdin/out.Jul 2 2020, 3:32 PM
Mateusz Grzeliński (grzelins) edited the summary of this revision. (Show Details)
  • Fix: show python evaluation errors in info editor
  • Print python eval logs: simplify implementation
  • Remove print
Mateusz Grzeliński (grzelins) edited the summary of this revision. (Show Details)
Mateusz Grzeliński (grzelins) added a project: Restricted Project.
Mateusz Grzeliński (grzelins) retitled this revision from WIP: Add experimental support for catching python stdin/out to Add support for catching python stdin/out.
Mateusz Grzeliński (grzelins) edited the summary of this revision. (Show Details)
  • updated to latest master
  • now catching python error works for files (internal and external) and strings