Re: [Tutor] user agent

2008-09-25 Thread Alan Gauld


Kent Johnson [EMAIL PROTECTED] wrote



Alan, I think you might have this backwards. I think jeremiah wants 
to

specify the user agent on the client side of the connection.


Ah! In that case it makes sense.
Ignore my ramblings :-)

Alan G 



___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] user agent

2008-09-24 Thread Alan Gauld
jeremiah [EMAIL PROTECTED] wrote 

I'm trying to force the user agent in a python login script... 


Might I ask why?
It should never be necessary and is extremely user hostile.
Especially given that many modern browsers are capable 
of emulating the troublesome ones - ie IE! And future versions 
might change the rules and you then have a huge maintenance 
overhead of keeping your list of browsers updated.


If at all possible it's better to put the effort into making your 
code browser neutral. Which mainly meams avoiding unusual 
HTML constructs, using ECMAscript rather than any vendor 
specific variant of JavaScript and not trying to control layout 
and style too closely (that's what PDF is for!)


question is what are the possible user agents I can specify 


Thats a changing question because the number of browsers 
and what they report to the server is changing constantly.

Its usually more common to simply specify a small subset
of the most common ones and anyone with the audacity to 
prefer an alternative hgets a more or less rude message 
telling them to pick another browser



print the user agent at the end of the script so I know that it was
accurately saved. Here is the first bit of my code.


Its stored in an environment variable. How you access that 
will depend on your server/framework but as a last resort 
os.getenv() should work.


--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] user agent

2008-09-24 Thread Kent Johnson
On Wed, Sep 24, 2008 at 7:55 PM, Alan Gauld [EMAIL PROTECTED] wrote:
 jeremiah [EMAIL PROTECTED] wrote

 I'm trying to force the user agent in a python login script...

 Might I ask why?
 It should never be necessary and is extremely user hostile.
 Especially given that many modern browsers are capable of emulating the
 troublesome ones - ie IE! And future versions might change the rules and you
 then have a huge maintenance overhead of keeping your list of browsers
 updated.

Alan, I think you might have this backwards. I think jeremiah wants to
specify the user agent on the client side of the connection.

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] user agent

2008-09-24 Thread Kent Johnson
On Wed, Sep 24, 2008 at 6:55 PM, jeremiah
[EMAIL PROTECTED] wrote:
 I'm trying to force the user agent in a python login script... My
 question is what are the possible user agents I can specify

Here is a rather long list:
http://www.user-agents.org/

but presumably there is a particular browser you want to emulate?

 and how do I
 print the user agent at the end of the script so I know that it was
 accurately saved.

I don't understand where you want to save the user agent.

Kent
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor