Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qtconsole : allow copy with shortcut in pager #1091

Closed
wants to merge 4 commits into from

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Dec 3, 2011

closes #1088

	'user_expression' does not exist with --pure, be more carefull..
@Carreau
Copy link
Member Author

Carreau commented Dec 3, 2011

I also added a little fix that avoid some error message when trying qtconsole with --pure as there won't be user_expressionin message comming from the kernel.

Actually I suspect that some of the gui menu of qtconsole might be broken with --pure

@Carreau
Copy link
Member Author

Carreau commented Dec 3, 2011

note that we might want to add a warning in the docstring of
console/console_widget.py: def can_copy(self):
Or change the implementation to check wether or not it returns true if selected text is in the pager...

Which way you think is the best ?

@minrk
Copy link
Member

minrk commented Dec 4, 2011

@Carreau - you are right, there are probably quite a few things broken in pure mode. I wish we would remove it, because nobody ever tests it, and there are huge amounts of duplicate code that typically are not updated in tandem with every change.

if text:
lines = map(transform_ipy_prompt, text.splitlines())
text = '\n'.join(lines)
QtGui.QApplication.clipboard().setText(text)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make 'transform_prompt` a widget trait (should be transform_classic_prompt in FrontendWidget, and transform_ipy_prompt in IPythonWidget), then we shouldn't have to override copy() in IPythonWidget at all.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite comfortable with trait , I can give a shot, bu you'll probably be done before I read enough to do it the right way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it can just be a class attribute. The traitness is unimportant.

@minrk
Copy link
Member

minrk commented Dec 6, 2011

When doing ipython qtconsole --pylab --paging vsplit, and do plot?, I cannot actually copy anything out of the pager area. So it would appear that this does not do what it claims, unless I am mistaken.

@Carreau
Copy link
Member Author

Carreau commented Dec 6, 2011

hum... I didn't thought of vsplit. I'll take a look.

	check which of the two widget have focus to know from which to copy
@Carreau
Copy link
Member Author

Carreau commented Dec 7, 2011

@minrk,
this seem to work with hsplit/vsplit and without splitter

@minrk minrk closed this in 7a144e2 Dec 7, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QtConsole : can't copy from pager
2 participants