Python Scripter Refactoring
ClosedPublic

Authored by eliakinalmeida on Dec 5 2016, 7:43 AM.

Details

Summary

This commit is a start point for the structure of the python scripter in the krita, then it's
a huge commit, but it's just a begin.

Added in this commit:

  • scripter.py just has the View extension now
  • the scripter has a instance of the UIController class
  • The UIController class knows the editor, highlighter, output and mainwidget(QDialog)
  • Action are added dynamically from the actions package
  • The path and add method are defined in the ActionLoader class in the loaders package
  • Loader classes can be used to dynamically include another components
  • The previously widgets are organized in different packages for each concern(it needs a better separation)
  • the document_scripter it will be the document package like a model.

Fixes T4551

Ref T1625

Diff Detail

Repository
R37 Krita
Branch
eliakinalmeida/T4551-interactive-python-scripting
Lint
No Linters Available
Unit
No Unit Test Coverage
eliakinalmeida retitled this revision from to Python Scripter Refactoring.
eliakinalmeida added a reviewer: rempt.
eliakinalmeida updated this object.
eliakinalmeida added a subscriber: eliakinalmeida.
rempt edited edge metadata.Jan 30 2017, 2:39 PM

Hm... I must be doing something wrong, though. Either I am looking at the wrong code, or I cannot figure out how to debug a script. The debugger shouldn't open a new file, it should start executing what's in the scripter. Likewise, the New menu option should clear the contents after asking the user whether they want to save, not create a new python file.

Hm... I must be doing something wrong, though. Either I am looking at the wrong code, or I cannot figure out how to debug a script.

This version of the scripter don't has the debugger feature. Take a look in https://phabricator.kde.org/D4303

The debugger shouldn't open a new file, it should start executing what's in the scripter.

The debugger doesn't open a new file it tries to debug the active document, but if not exists, a new file must be created.

Likewise, the New menu option should clear the contents after asking the user whether they want to save, not create a new python file.

This is exacly what is made. When the New option is clicked, the active document and Gui are cleared. A new document is not created yet.

rempt added a comment.Feb 1 2017, 11:34 AM

Okay, I got it working now! Cool stuff -- though we really need to do something about the layout and the design of the debugger. It might be more convenient to have a qt-creator like layout where output and debugger are in separate side-by-side panes.

In D3592#82198, @rempt wrote:

Okay, I got it working now! Cool stuff -- though we really need to do something about the layout and the design of the debugger. It might be more convenient to have a qt-creator like layout where output and debugger are in separate side-by-side panes.

Cool. I'm thinking in something with a new QDialog, what do you think? We can talk with the krita community also.

woltherav accepted this revision.Dec 7 2017, 3:06 PM
This revision is now accepted and ready to land.Dec 7 2017, 3:06 PM
woltherav closed this revision.Dec 7 2017, 3:06 PM

This was pushed :)