-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Implement TikZ images for problems #1030
Conversation
external convert program.
@@ -128,7 +133,7 @@ $externalPrograms{pngtopnm} = "$netpbm_prefix/pngtopnm"; | |||
#################################################### | |||
# set timeout time (-t 40 sec) to be less than timeout for problem (usually 60 seconds) | |||
$externalPrograms{checkurl} = "/usr/bin/lwp-request -d -t 40 -mHEAD "; # or "/usr/local/bin/w3c -head " | |||
$externalPrograms{curlCommand} = "/usr/bin/curl"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the curlCommand is used in a number of places. It would be better to leave it for now (in addition to the
definition for {curl}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/Volumes/WW_test/opt/webwork/webwork2_2018/lib/WeBWorK/PG.pm:211: $envir{externalCurlCommand} = $ce->{externalPrograms}->{curlCommand};
and
/Volumes/WW_test/opt/webwork/pg_2018/lib/PGcore.pm:769: $options->{curlCommand} = WeBWorK::PG::IO::curlCommand(); #FIXME just changed from alternate source
Also curlCommand occurs in several places in PG/IO.pm where it looks like the code is in the midst of a change over from curlCommand to curl. Using curlCommand within IO.pm and askSage() might
be ok -- it makes some of the commands to askSage clearer. I could go either way.
#FIXME change {curlCommand} to {curl}, here, and site.conf
sub WeBWorK::PG::IO::curlCommand {
# $CE->{externalPrograms}->{curlCommand};
$CE->{externalPrograms}->{curl};
}
The other places, outside of those subroutines it seems to me that using {curl} as you have done is clearer. I no longer remember my exact thinking when I was last working on this code. What do you think? should we change all occurrences of curlCommand to curl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could put it back if you think that would be safer. I was just trying to complete what was done in your tikz pull request. It does seem the naming was inconsistent relative to the other external program variables. I had thought I changed all instances of {curl command} to {curl}. Perhaps I missed some.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On closer inspection I think you only missed one. The line
211 in PG.pm . This defines a variable in the PG environment called
externalCurlCommand. I don't see where that is ever used.
I think I'm in favor of commenting out line 211 in PG.pm (see whether that ever causes problems).
I've decided I'm ok with continuing to use curlCommand inside askSage and IO.pm since I believe my idea there was that we might want to add additional switches to the bare curl command and therefore created a front end subroutine to make it easier to modify the bare curl command if we needed to. I'm willing to change my mind on that if you think that is over complicating things.
I was trying to make the assignments in site.conf more uniform -- and assigning {curlCommand} stuck out -- so you were following my initial intentions there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I did miss line 211 of PG.pm. We can comment that out, or just adjust it to be {curl}, or put everything back the way it was. That isn't part of the tikz image work, and I don't want it to interfere with getting that in. Just let me know what you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't remove the curl command. I just renamed it (based on your suggestion in the old code), and I have checked that all uses have the new name.
Let's adjust it to be curl (for compatibility) but then comment it out. I
don't see why we should expose curl directly as a command within a PG
problem or .pl macro. It seems like it could be asking for security
trouble and I can't imagine a common use case. I could be wrong in which
case it will be easy enough to uncomment the line.
…On Wed, Dec 25, 2019 at 7:20 PM Glenn Rice ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In conf/site.conf.dist
<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openwebwork_webwork2_pull_1030-23discussion-5Fr361343849&d=DwMCaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=C6Pt5AGtImanmAdcooarL-JZO8M5dSFPfs3VweYXYkE&m=FjTtJB3kljELaOFxMLo8tAZYZ1rPK0DBtMEhqIM_FOE&s=hLesds84GRDMqzgNtDTRpa0HXHq_pbY-pcBsf7U6I_s&e=>
:
> @@ -128,7 +133,7 @@ $externalPrograms{pngtopnm} = "$netpbm_prefix/pngtopnm";
####################################################
# set timeout time (-t 40 sec) to be less than timeout for problem (usually 60 seconds)
$externalPrograms{checkurl} = "/usr/bin/lwp-request -d -t 40 -mHEAD "; # or "/usr/local/bin/w3c -head "
-$externalPrograms{curlCommand} = "/usr/bin/curl";
I see. I did miss line 211 of PG.pm. We can comment that out, or just
adjust it to be {curl}, or put everything back the way it was. That isn't
part of the tikz image work, and I don't want it to interfere with getting
that in. Just let me know what you prefer.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openwebwork_webwork2_pull_1030-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAAJF27AB6AQCPOROYRWLQLLQ2P2EHA5CNFSM4I3UCM6KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCQGOQIQ-23discussion-5Fr361343849&d=DwMCaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=C6Pt5AGtImanmAdcooarL-JZO8M5dSFPfs3VweYXYkE&m=FjTtJB3kljELaOFxMLo8tAZYZ1rPK0DBtMEhqIM_FOE&s=HmWdAGAK4s9fGFyEaZecImHilJczAri5Ajqej9HWwmU&e=>,
or unsubscribe
<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AAJF27A25WUP3J3HPYOAAGDQ2P2EHANCNFSM4I3UCM6A&d=DwMCaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=C6Pt5AGtImanmAdcooarL-JZO8M5dSFPfs3VweYXYkE&m=FjTtJB3kljELaOFxMLo8tAZYZ1rPK0DBtMEhqIM_FOE&s=o6FBpknOPwDJ04ypVRk8QNpEeH1zn-C8u4qNvFrNCyI&e=>
.
|
to $externalPrograms{curl}. Then comment that out as per the discussion in PR openwebwork#1030.
A comment about the need to make the change to |
See openwebwork/pg#432