View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014388ParaView(No Category)public2013-11-01 16:202015-11-04 21:31
ReporterAlan Scott 
Assigned ToCory Quammen 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Versiongit-master 
Target VersionFixed in Version 
Summary0014388: Paste multiple lines into the python shell is broken.
DescriptionLinux, local server, master.
Run ParaView. Tools/ Python Shell. Now, cut and paste the following into the shell. It doesn't work.


try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

Sphere1 = Sphere()

RenderView1 = GetRenderView()
DataRepresentation1 = Show()
DataRepresentation1.ScaleFactor = 0.1
DataRepresentation1.SelectionPointFieldDataArrayName = 'Normals'
DataRepresentation1.EdgeColor = [0.0, 0.0, 0.5000076295109483]

RenderView1.CameraPosition = [0.0, 0.0, 3.2903743041222895]
RenderView1.CameraClippingRange = [2.2624705610810665, 4.592229918684124]
RenderView1.CameraParallelScale = 0.8516115354228021

Render()

TagsNo tags attached.
ProjectSandia
Topic Name
Typeincorrect functionality
Attached Files

 Relationships
related to 0015612closedSchuyler Kylstra Pasting text in Python Shell does nothing 

  Notes
(0031824)
Utkarsh Ayachit (administrator)
2013-11-04 11:19

Note: this should have been working as Pat mentioned on the mailing list:

commit af99ee38d6edcefaeb5f5bd2936f0bf82bdcf565
Author: Pat Marion <pat.marion@kitware.com>
Date: Fri May 24 12:23:56 2013 +1000

    Change the behavior of pqPythonShell::pushScript() to split over newlines
    
    Previously, you could not paste multiline statements into the ParaView
    python console. This commit changes the behavior of the pushScript()
    function so that it splits the script code over the newline character
    and pushes each line separately.
    
    This does change the behavior of entering multiline statements: previously
    pushScript() would attempt to detect the indent and start the next line
    using the indent of the previous line. This behavior has been removed.
    
    The new behavior closely matches the behavior of the standard commandline
    python interpreter.
    
    Change-Id: I899ec69194a1cce3d82cefc2f13048aad8f81fec
(0031910)
Cory Quammen (developer)
2013-12-07 00:09
edited on: 2013-12-07 00:11

Hi Alan,

I wasn't able to reproduce this on either Linux or Windows on master. I did have to remove the line

paraview.simple._DisableFirstRenderCameraReset()

to eliminate one error.

Can you elaborate on the error you see?

Thanks,
Cory

(0032888)
Cory Quammen (developer)
2014-06-17 16:09

Alan,

I still cannot reproduce this on either Linux or Windows.

Can you retest and close this bug if it works for you?

Note that you need to remove the line

paraview.simple._DisableFirstRenderCameraReset()

Thanks,
Cory
(0032889)
Alan Scott (manager)
2014-06-17 16:49

Cory,
I had Utkarsh try this, and we figured out the confusion. I cut this script (at bottom of this note) in Windows, then pasted it into the Linux Python console using the middle mouse button. This failed, and Utkarsh replicated it. Then, we tried pasting with <ctrl>-V, and that worked. Thus, the issue has to do with pasting in Linux, with the middle mouse button.

It is not critical this bug gets fixed for the 4.2 release (although I wouldn't complain if it did get in).

Here is the script Utkarsh and I used:

try: paraview.simple
except: from paraview.simple import *

Sphere1 = Sphere()

RenderView1 = GetRenderView()
DataRepresentation1 = Show()
DataRepresentation1.ScaleFactor = 0.1
DataRepresentation1.SelectionPointFieldDataArrayName = 'Normals'
DataRepresentation1.EdgeColor = [0.0, 0.0, 0.5000076295109483]

RenderView1.CameraPosition = [0.0, 0.0, 3.2903743041222895]
RenderView1.CameraClippingRange = [2.2624705610810665, 4.592229918684124]
RenderView1.CameraParallelScale = 0.8516115354228021

Render()
(0035171)
Cory Quammen (developer)
2015-09-03 17:35

Debugging notes for myself:

In pqConsoleWidget, the command buffer is set to be the text following the InteractivePosition member variable. When middle-clicking, InteractivePosition gets set to 653, presumably the end of the pasted buffer. When using ctrl-V, InteractivePosition is 146 (after all the preamble stuff). TODO - figure out why the InteractivePosition is being moved to the end of the pasted buffer when middle clicking.
(0035174)
Cory Quammen (developer)
2015-09-04 12:51

https://gitlab.kitware.com/paraview/paraview/merge_requests/355 [^]
(0035425)
Alan Scott (manager)
2015-11-04 21:31

Yep, that works. Nice.

Tested Linux, master, local server, OGL2.

 Issue History
Date Modified Username Field Change
2013-11-01 16:20 Alan Scott New Issue
2013-11-04 11:18 Utkarsh Ayachit Assigned To => Cory Quammen
2013-11-04 11:19 Utkarsh Ayachit Note Added: 0031824
2013-12-07 00:09 Cory Quammen Note Added: 0031910
2013-12-07 00:09 Cory Quammen Status backlog => active development
2013-12-07 00:11 Cory Quammen Note Edited: 0031910
2014-06-17 16:09 Cory Quammen Note Added: 0032888
2014-06-17 16:49 Alan Scott Note Added: 0032889
2014-12-22 23:20 Cory Quammen Status active development => todo
2015-09-03 17:35 Cory Quammen Note Added: 0035171
2015-09-04 12:51 Cory Quammen Note Added: 0035174
2015-09-04 12:51 Cory Quammen Status todo => active development
2015-09-09 09:57 Utkarsh Ayachit Status active development => customer review
2015-09-09 09:57 Utkarsh Ayachit Resolution open => fixed
2015-09-10 16:27 Cory Quammen Relationship added related to 0015612
2015-11-04 21:31 Alan Scott Note Added: 0035425
2015-11-04 21:31 Alan Scott Status customer review => closed


Copyright © 2000 - 2018 MantisBT Team