This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Hobson.Lane
Recipients Arfrever, Hobson.Lane, Roman.Evstifeev, benjamin.peterson, cvrebert, eric.araujo, ganadist, giampaolo.rodola, larry, pitrou, r.david.murray, rosslagerwall, smarnach, tebeka
Date 2012-05-25.19:50:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CACZ_DofYO9vxWptNEqX6JeK5dh-SYc_8m4WL8mwPxEsydkWcdQ@mail.gmail.com>
In-reply-to <1337946002.62.0.116686324415.issue3177@psf.upfronthosting.co.za>
Content
Could even add an `operation` parameter to let the caller select actions,
including 'auto'  implemented as Larry suggests. Sometimes you feel like
trusting the user's xdg-open preferences/settings. Sometimes you don't.
Easy enough to let the caller choose, rather than the OS.

    operation in ['auto', 'run', 'edit', 'display', 'browse', 'explore',
'share', 'send', 'like', 'email', 'open', 'xdg-open', ...] # can
be incrementally added/implemented

Each op requires 1 conditional and gives a lot more utility without
requiring much more launch/action code that hasn't already been
tested/debugged on all relevant platforms. And the `operation` parameter is
a semi-standard used by MS, easing the transition for Win-devs migrating
gui code to python and linux (or cross-platform implementations).

On Fri, May 25, 2012 at 4:40 AM, Larry Hastings <report@bugs.python.org>wrote:

>
> Larry Hastings <larry@hastings.org> added the comment:
>
> > As an example, ``os.startfile("a.py")`` will usually run `a.py`
> > in the Python interpreter, while ``xdg-open a.py`` it will
> > usually open the source code in an editor on Linux.
>
> Well, so how about on UNIX shutil.launch (or whatever it's called) first
> checks to see if we're referring to a file.  If we are, check to see if
> it's marked executable.  If it is, execute it under a shell.  Failing
> *that* we could run xdg-open where available.
>
> ----------
> nosy: +larry
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue3177>
> _______________________________________
>
History
Date User Action Args
2012-05-25 19:50:47Hobson.Lanesetrecipients: + Hobson.Lane, tebeka, pitrou, larry, giampaolo.rodola, benjamin.peterson, eric.araujo, ganadist, Arfrever, r.david.murray, cvrebert, rosslagerwall, smarnach, Roman.Evstifeev
2012-05-25 19:50:47Hobson.Lanelinkissue3177 messages
2012-05-25 19:50:47Hobson.Lanecreate