View Issue Details

IDProjectCategoryView StatusLast Update
0001227Slicer4Core: Usabilitypublic2018-03-02 11:06
Reporterdpace Assigned Tomayeul.chassagnard  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.6.0Fixed in VersionSlicer 4.6.0 
Summary0001227: Python console automatically adds () after function names
Description

Makes it difficult to type in parameters, since one always has to delete the final )

Should either:

  • show the ( only when there are parameters, optionally showing () for non-overloaded functions with no parameters (would be nice, but likely tricky to do)
    or
  • show (), and automatically place the cursor between
TagsNo tags attached.

Activities

jcfr

jcfr

2012-06-01 12:00

administrator   ~0004748

From Chris - June 1st 2012:

Also here is my latest fix on the cursorOffset issue. I'm still working on how I'm going to do the consolidation of pythonModule and pythonObject. However, this one takes into account multiline statements and also fixes all the crash cases I could find.
https://github.com/chrismullins/CTK/commit/934fcf55ebf0238543326d68d62de4ca81fd9c2d

2012-06-06 07:10

 

jcfr

jcfr

2012-06-06 07:10

administrator   ~0004778

See to fail with custom class. See enclosed screenshot.

jcfr

jcfr

2012-06-06 07:12

administrator   ~0004779

Make sure to consolidate the two methods pythonObject and pythonModule

2012-06-07 12:37

 

pythonAutocomplete.png (26,822 bytes)
pythonAutocomplete.png (26,822 bytes)
crmullin

crmullin

2012-06-07 12:42

developer   ~0004790

This fix appears to work for me:
https://github.com/chrismullins/CTK/commit/d4d8c7ebedbfb101c5cbbacdc419eb4ffbf151ee

However, I believe I've made the case stronger that pythonObject and pythonModule need to be together. Perhaps adding an optional parameter to pythonObject which makes it function just like pythonModule (essentially ignoring the last part of the function) ?

Edit: Also I now see that it's impossible to tell if it works from that screenshot as the cursor must have blinked then. But that's how I tested it, since I was also concerned about retrieving classes within classes. Please try it out and break it if you can.

jcfr

jcfr

2012-06-11 19:38

administrator   ~0004810

Last edited: 2012-06-11 19:38

I gave a try and it works better :)

Few remarks:

1) Could you also update the associates tests ?

2) When a non-static method associated with a python class is auto-completed, the first argument should be ignored since it corresponds to "self", the user is not expected to provide a value. See ctkSimplePythonShell-Understand-self.png

2012-06-11 19:38

 

crmullin

crmullin

2012-06-28 11:18

developer   ~0004976

I'm not having much luck simulating multi-line statements (such as declaring a class) within the tests. I'll keep looking into it.

  1. This is just a matter of subtracting one, since this will always be the case for non-static functions.
    https://github.com/chrismullins/CTK/commit/2cc22a7bc5699212bf515f7349f7fbf43506cf37
jcfr

jcfr

2016-07-19 13:42

administrator   ~0014043

@Mayeul: Here is the full topic of Chris:

https://github.com/chrismullins/CTK/commits/python-autocomplete-parameter-detection

It is an old topic and it doesn't rebase cleanly
Since some code change ... you would have to strategically review and integrate what makes sense.

@Chris: It will happen :)

jcfr

jcfr

2016-08-15 17:38

administrator   ~0014068

Fixed in r25289
See http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25289

Related Changesets

Import 2017-06-07 23:51:09: master 296190a2

2016-08-15 17:28:24

jcfr

Details Diff
ENH: Update CTK to include ctkPythonConsole fixes - Fixes 0001227

This commit integrates the following changes:

$ git shortlog 5b7dc1a..335e386 --no-merges
Christopher Mullins (4):
ENH: ctkPytonConsole: Move cursor between parentheses if parameters detected
ENH: ctkPythonConsole: Enable cursorOffset on multiline statements
ENH: ctkPythonConsole: Offset cursor for function in user-defined classes
ENH: ctkPythonConsole: Ignores "self" parameter

Johan Andruejol (1):
Allow user to set/reset the range in ctkVTKHistogram

Marco Nolden (3):
Update to DCMTK-3.6.1_20150924 in superbuild
Remove DCMTK 3.6.0 compatibility cruft
Fix some Qt5 component issues

Mayeul Chassagnard (1):
ENH: Improve ctkAbstractPythonManager tests

mayeul (6):
ENH: Add Continous Integration Support
ENH: Improve Continuous Integration Support with graphical display
STYLE: Add icon passed/failed in README linked to CDash
ENH: Add test examples and switch to debug mode
ENH: Add Site and Build Name for CDash
ENH: ctkBackTraceTest should be run only in Debug Mode

mpkh (1):
get rid of "_FORTIFY_SOURCE redefined" build warnings

git-svn-id: http://svn.slicer.org/Slicer4/trunk@25289 3bd1e089-480b-0410-8dfb-8563597acbee
mod - SuperBuild/External_CTK.cmake Diff File

Issue History

Date Modified Username Field Change
2011-06-29 15:15 dpace New Issue
2011-06-29 15:15 dpace Status new => assigned
2011-06-29 15:15 dpace Assigned To => jcfr
2012-05-09 12:29 jcfr Assigned To jcfr => crmullin
2012-05-09 12:29 jcfr Target Version => Slicer 4.2.0 AHM Summer 2012
2012-06-01 12:00 jcfr Note Added: 0004748
2012-06-06 07:10 jcfr File Added: python-autocomplete-parameter-detection-problem.png
2012-06-06 07:10 jcfr Note Added: 0004778
2012-06-06 07:12 jcfr Note Added: 0004779
2012-06-07 12:37 crmullin File Added: pythonAutocomplete.png
2012-06-07 12:42 crmullin Note Added: 0004790
2012-06-11 19:38 jcfr Note Added: 0004810
2012-06-11 19:38 jcfr File Added: ctkSimplePythonShell-Understand-self.png
2012-06-11 19:38 jcfr Note Edited: 0004810
2012-06-28 11:18 crmullin Note Added: 0004976
2012-08-20 10:00 jcfr Target Version Slicer 4.2.0 - Feature freeze Sept 1st 2012 => Slicer 4.2.5
2012-08-21 09:39 jcfr Target Version Slicer 4.2.5 => Slicer 4.3.0
2013-08-30 13:28 jcfr Target Version Slicer 4.3.0 => Slicer 4.3.1
2013-10-04 00:52 jcfr Target Version Slicer 4.3.1 => Slicer 4.3.2
2014-03-06 10:15 nicole Target Version Slicer 4.3.2 => Slicer 4.4.0
2014-05-13 09:59 jcfr Assigned To crmullin => jcfr
2014-07-29 10:09 jcfr Target Version Slicer 4.4.0 => Slicer 4.5.0-1
2015-11-02 05:06 jcfr Target Version Slicer 4.5.0-1 => Slicer 4.5.1
2016-07-18 16:09 jcfr Assigned To jcfr => mayeul.chassagnard
2016-07-19 13:42 jcfr Note Added: 0014043
2016-08-15 17:38 jcfr Note Added: 0014068
2016-08-15 17:38 jcfr Status assigned => resolved
2016-08-15 17:38 jcfr Fixed in Version => Slicer 4.6.0
2016-08-15 17:38 jcfr Resolution open => fixed
2016-10-13 01:27 jcfr Target Version Slicer 4.5.1 => Slicer 4.6.0
2017-06-10 08:51 jcfr Changeset attached => Slicer master 296190a2
2018-03-02 11:06 jcfr Status resolved => closed