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

interact : incomplete default string in the input box #4524

Closed
seblabbe opened this issue Nov 14, 2008 · 6 comments
Closed

interact : incomplete default string in the input box #4524

seblabbe opened this issue Nov 14, 2008 · 6 comments

Comments

@seblabbe
Copy link
Contributor

Using interact in sage 3.1.4, the default string doesn't print completly in the input box. It looks like it prints up to the first character ' found.
The folowing example works well

@interact
def _(a=input_box(default='interact is "cool"',type=str,label='Name:')):
    print a

and it puts interact is "cool" in the input box. But in the next one,

@interact
def _(a=input_box(default="interact is 'cool'",type=str,label='Name:')):
    print a

the default string in the input box is incomplete, it puts only *interact is *. So, we don't know if interact is cool or not !

Component: interact

Keywords: input_box

Issue created by migration from https://trac.sagemath.org/ticket/4524

@mwhansen
Copy link
Contributor

Attachment: trac_4524.patch.gz

@seblabbe
Copy link
Contributor Author

comment:2

First, that is the first time I review a patch. So if you have comment on the way I review, tell me. I also have some questions that I write below as I have them. Moreover, I am not familiar with notebook code at all....so should I let the job to somebody else?

However, I applied the patch and I can at least say that the problem I submitted is now fixed which is cool!

There is a small issue here (double that) :

Note that any HTML that that uses quotes around this should use double quotes and not single quotes. 

Also, I don't know if you agreee, but I suggest to add the second example below :

EXAMPLES: 
    sage: from sage.server.notebook.interact import InteractControl 
    sage: InteractControl('x', '"cool"').html_escaped_default_value() 
    '"cool"' 
    sage: InteractControl('x',"'cool'").html_escaped_default_value()
    "'cool'"

My last question is : I could have posted a patch for both issues (double that, and the 2nd example). What is commonly done? Do we leave the changes to the patcher?

My statement is Positive review pending fixes on at least the first of my two doc-suggestions.

Thanks for the fix,

@seblabbe seblabbe changed the title interact : incomplete default string in the input box [positive review pending doc fixes] interact : incomplete default string in the input box Jan 23, 2009
@mwhansen
Copy link
Contributor

comment:3

I've posted a patch which addresses the issues.

You could have posted a patch and then asked me to review your portion of the patch.

@mwhansen mwhansen changed the title [positive review pending doc fixes] interact : incomplete default string in the input box interact : incomplete default string in the input box Jan 24, 2009
@seblabbe
Copy link
Contributor Author

comment:4

Attachment: trac_4524-2.patch.gz

Positive review.

@seblabbe
Copy link
Contributor Author

comment:5

I think it can be merged in sage 3.3.

@seblabbe seblabbe modified the milestones: sage-3.4.1, sage-3.3 Jan 24, 2009
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Jan 24, 2009

comment:6

Merged in Sage 3.3.alpha2

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Jan 24, 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants