[Patches] [ python-Patches-754022 ] Greatly enhanced webbrowser.py
SourceForge.net
noreply at sourceforge.net
Thu Sep 22 05:35:51 CEST 2005
Patches item #754022, was opened at 2003-06-14 00:24
Message generated for change (Comment added) made by quiver
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=754022&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Oleg Broytmann (phd)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Greatly enhanced webbrowser.py
Initial Comment:
The patch enhances webbrowser.py.
First, all calls to os.system return result code, and
the inverse of the code (it is ok/fail status) passed
through all higher-level routines up to top-level call
to open(url). This allows to check if a browser was
really started.
Second, the very open() modified so it is now trying to
run all registered browsers in order until a browser
returns 1.
Third, the file can be used as a program: webbrowser.py
url. Optional parameters -n allows to open the url in a
new window.
----------------------------------------------------------------------
Comment By: George Yoshida (quiver)
Date: 2005-09-22 12:35
Message:
Logged In: YES
user_id=671362
Minor nit.
11.1.1 Browser Controller Objects
from the description of open method::
> If new is true, a new browser window is opened if possible.
Now "new" can be 0, 1 or 2. This part also needs an update.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-09-16 16:28
Message:
Logged In: YES
user_id=4799
Arguable (especially compared with smtpd.py), but I am not
goint to argue. Please apply the patch and let us see what
other people think and say. It seems there are enough users...
----------------------------------------------------------------------
Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-16 15:32
Message:
Logged In: YES
user_id=1188172
Granted, but you will concur that starting a webbrowser
isn't something that the command line user normally wants to
do via a Python script.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-09-16 06:52
Message:
Logged In: YES
user_id=4799
>From setup.py:
scripts = ['Tools/scripts/pydoc',
'Tools/scripts/idle',
'Lib/smtpd.py']
See, Python installs 3 scripts into /usr/{local/}bin/ -
pydoc, idle and smtpd.py.
----------------------------------------------------------------------
Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-16 05:48
Message:
Logged In: YES
user_id=1188172
No other module that can be used standalone delivers such a
script. There's also the question where to install it, etc.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-09-16 05:18
Message:
Logged In: YES
user_id=4799
In the main():
opts, args = getopt.getopt(sys.argv[1:], 'ntd')
You can remove 'd' as you've dropeed debugging prints.
Are you going to drop standalone webbrowser script? Is
"python -m webbrowser" enough?
----------------------------------------------------------------------
Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-16 04:49
Message:
Logged In: YES
user_id=1188172
Ah, thanks. I had already corrected #1, but didn't look
closely enough for #2.
----------------------------------------------------------------------
Comment By: George Yoshida (quiver)
Date: 2005-09-16 02:26
Message:
Logged In: YES
user_id=671362
Let me point out two problems:
o NameError
if remote_background:
cmd += ' &'
=>
if self.remote_background: # add "self."
cmd += ' &'
o copy and paste mistake?
\lineiii{'mozilla'}{\class{Mozilla('mozilla')}}{}
\lineiii{'firefox'}{\class{Mozilla('mozilla')}}{}
=>
\lineiii{'mozilla'}{\class{Mozilla('mozilla')}}{}
\lineiii{'firefox'}{\class{Mozilla('firefox')}}{}
----------------------------------------------------------------------
Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-15 17:07
Message:
Logged In: YES
user_id=1188172
Adding new patch (webbrowser.diff), enhanced with other
patches and bugfixes here on SF.
Also updated the docs with changed/added notes.
Please review, I'll apply this for 2.5.
----------------------------------------------------------------------
Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-06-02 01:33
Message:
Logged In: YES
user_id=1188172
I have reviewed this one too, and I really recommend to
apply it for 2.5.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-30 20:02
Message:
Logged In: YES
user_id=4799
Added Opera controller to the doc.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-30 20:01
Message:
Logged In: YES
user_id=4799
Added remote functionality for Opera on Unix.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-29 17:50
Message:
Logged In: YES
user_id=4799
Updated documention patch - added a section about webbrowser
script and its command-line options and arguments.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-29 17:48
Message:
Logged In: YES
user_id=4799
Changed _isexecutable() on w32 to test for executable
extensions (.exe, bat) . Tested on Linux with
Mozilla/links/elinks; on w32 with Mozilla/Opera/Firefox.
----------------------------------------------------------------------
Comment By: Rodrigo Dias Arruda Senra (rodsenra)
Date: 2005-03-29 06:25
Message:
Logged In: YES
user_id=9057
I have revised: libwebbrowser.tex.patch and
webbrowser.py.patch.
They are Ok, I recommend to apply both. Outstanding work.
However, I would withdraw the webbrowser wrapper script,
since the same functionality can be accomplished with:
python -m webbrowser http://www.python.org
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-28 23:21
Message:
Logged In: YES
user_id=4799
Patch for documentation.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-28 23:19
Message:
Logged In: YES
user_id=4799
Minor bugfix.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-24 22:30
Message:
Logged In: YES
user_id=4799
Do not report error if the browser doesn't support tabs -
just open the URL in a new window.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-24 22:14
Message:
Logged In: YES
user_id=4799
I've reworked the patch once more. I moved some common
functionality into the UnixBrowser class and added two new
features - Elinks launcher class (elinks supports remote
commands in a manner very similar to Mozilla) and new-tab
functionality for browsers that support tabbed browsing
(Mozilla and elinks); a user can now run "webbrowser -t URL"
to open the URL a new tab. All classes in the module are now
new-style classes (except for the Error class).
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-24 06:18
Message:
Logged In: YES
user_id=4799
Uploading webbrowser wrapper script. Put it into
Tools/scripts directory, and add to the end of setup.py.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-24 06:17
Message:
Logged In: YES
user_id=4799
There's no uploaded file! You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file. In addition, even if you
*did* check this checkbox, a bug in SourceForge
prevents attaching a file when *creating* an issue.
Please try again.
(This is a SourceForge annoyance that we can do
nothing about. :-( )
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-24 06:14
Message:
Logged In: YES
user_id=4799
I've moved script code to main() function.
----------------------------------------------------------------------
Comment By: Rodrigo Dias Arruda Senra (rodsenra)
Date: 2005-03-24 04:25
Message:
Logged In: YES
user_id=9057
I have reviewed this patch in 2005-03-23 and recommend it to
be applied !
Oleg have made the comments below to Python-dev, and those
must be taken into consideration while applying this patch.
http://python.org/sf/728278
Close with resolution "partially applied, partially
rejected".
http://python.org/sf/754022
Review and apply! ;)
http://python.org/sf/1166780
Close with resolution "applied". (Though it was not
applied in
exactly that form...)
http://python.org/sf/1077979
Close with resolution "applied long ago".
http://python.org/sf/1144816
Close with resolution "duplicate of 1077979".
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-24 03:06
Message:
Logged In: YES
user_id=4799
I've consolidated patches 728278, 754022, 954628, 1166780
into this single patch. Some parts of those patches were
applied, some rejected, many things changed. I also added
elinks support - currently it is very similar to links.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2004-12-07 20:23
Message:
Logged In: YES
user_id=4799
Applied the patch from http://python.org/sf/1077979.
----------------------------------------------------------------------
Comment By: Raymond Hettinger (rhettinger)
Date: 2004-10-20 15:11
Message:
Logged In: YES
user_id=80475
Too late for Py2.4.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2004-10-07 16:48
Message:
Logged In: YES
user_id=4799
And don't forget to make it executable.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=754022&group_id=5470
More information about the Patches
mailing list