View Issue Details

IDProjectCategoryView StatusLast Update
0000489FreeCADFeaturepublic2011-12-10 13:43
Reporterzappl Assigned Towmayer  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.11 
Target Version0.13Fixed in Version0.13 
Summary0000489: python console: "RFC"s for even more "rapid" prototyping :-)
DescriptionHi everybody,

FreeCAD is really nice for rapid prototyping geometric algorithms in python.
However, in FreeCAD (0.11 ... HEAD@5152), I find the behaviour of the python console quite a bit "unnatural" compared to others (e.g. the native python console, got by calling python at the command shell).

* free cursor movement throughout the whole console is confusing
* previous input lines including the prompt of the current input line can be changed. This leads easily to syntax errors, e.g. hitting backspace too often might lead to a malformed prompt.
* it's not possible to dismiss the current input line but to delete it via backspace. Well, I find myself using this quite often on the linux console ...
* accessing the history by Ctrl+Up/Down might be a matter of taste, but for frequent use, I find it too complicated. I'd skip the Ctrl-modifier.
* history backward search via considering the current input could really speed up things. e.g. entering "for" + pressing Up, searches the latest history item starting with "for", like "for d in sys.path:".
* for calling methods the CallTips are a great feature, but it does not add the needed parentheses. For typing the argument list, it might be handy to place the cursor between those.

I played a bit with the source and found some solutions I'd like share as a "RFC" :-).
There are two independent patches for the points above:
* pyconsole_rfc_keyMap+history.patch - changing the key mapping and adding backward history search
* pyconsole_rfc_callCompletion.patch - adds a first approach for a little help on calling methods

regards,
zappl
TagsNo tags attached.
FreeCAD Information

Activities

2011-11-21 14:49

 

pyconsole_rfc.zip.zip (Attachment missing)

wmayer

2011-11-21 18:20

administrator   ~0001341

Thanks but will be accepted for version 0.13 as discussed on the forum.

wmayer

2011-12-10 13:43

administrator   ~0001446

Added in rev 5253. Works great, thank you!

(I have put the content of Temporary.hpp to CallTips.cpp)

Issue History

Date Modified Username Field Change
2011-11-21 14:49 zappl New Issue
2011-11-21 14:49 zappl File Added: pyconsole_rfc.zip.zip
2011-11-21 18:20 wmayer Note Added: 0001341
2011-11-21 18:20 wmayer Assigned To => wmayer
2011-11-21 18:20 wmayer Status new => assigned
2011-11-21 18:20 wmayer Target Version => 0.13
2011-12-10 13:43 wmayer Note Added: 0001446
2011-12-10 13:43 wmayer Status assigned => closed
2011-12-10 13:43 wmayer Resolution open => fixed
2011-12-10 13:43 wmayer Fixed in Version => 0.13