Merge lp://staging/~stefano-palazzo/gpxviewer/gpxviewer-null-pub into lp://staging/gpxviewer

Proposed by Stefano Palazzo
Status: Needs review
Proposed branch: lp://staging/~stefano-palazzo/gpxviewer/gpxviewer-null-pub
Merge into: lp://staging/gpxviewer
Diff against target: 46 lines (+19/-4)
1 file modified
gpxviewer/ui.py (+19/-4)
To merge this branch: bzr merge lp://staging/~stefano-palazzo/gpxviewer/gpxviewer-null-pub
Reviewer Review Type Date Requested Status
Andrew Gee Pending
Review via email: mp+40262@code.staging.launchpad.net

Commit message

Add "do you want to install..." dalog
Open External apps even without open file
Replac os.spawn with subprocess.Popen

Description of the change

I've notices that, when clicking on "Open with external Program..", nothing happens when
a) the application is not installed
b) no file is opened

So I've changed the code to:
a) ask the user if they want to install the application, if so, install it (transparently, using apt://..)
b) open the application without sending it a file name to open

I've also replaced os.spawn with subprocess.Popen (not that that's important, but it's recommended)

If you're happy with those changes, I think they might be a nice addition to this fantastic application.

To post a comment you must log in.
82. By Stefano Palazzo

minor cleanup

Revision history for this message
Andrew Gee (andrewgee) wrote :

Hi Stefano,

Thanks for the merge request. Looks like good work, from a quick glance.
I've been a bit busy this weekend, but should be able to review the code
later today or tomorrow and merge it in.

Thanks for your contribution :)

Andrew Gee

On 06/11/10 22:48, Stefano Palazzo wrote:
> Stefano Palazzo has proposed merging lp:~stefano-palazzo/gpxviewer/gpxviewer-null-pub into lp:gpxviewer.
>
> Requested reviews:
> Andrew Gee (andrewgee)
>
>
> I've notices that, when clicking on "Open with external Program..", nothing happens when
> a) the application is not installed
> b) no file is opened
>
> So I've changed the code to:
> a) ask the user if they want to install the application, if so, install it (transparently, using apt://..)
> b) open the application without sending it a file name to open
>
> I've also replaced os.spawn with subprocess.Popen (not that that's important, but it's recommended)
>
> If you're happy with those changes, I think they might be a nice addition to this fantastic application.

Revision history for this message
Andrew Gee (andrewgee) wrote :

Hi Stefano,

I've got around to reviewing your contribution, finally. Sorry for taking so long. The only thing I am hesitant about is if a user would try to run gpxviewer on an rpm based distribution. I'm wondering if there's a special python module to be able to handle invoking package management across platforms. I'm sure another application has had a similar problem before.

Or maybe we should just build in a check for a debian based distribution, and throw up a generic error message otherwise?

I'm going to look into it. Let me know if you come up with any ideas or thoughts :)

Thanks,
Andrew

Revision history for this message
Stefano Palazzo (stefano-palazzo) wrote :

Hi Andrew,

I've just tested this on a fresh machine, and it doesn't seem to work.
Never mind that didn't even think about making this work with other
distributions, it doesn't even seem to work right in Ubuntu.

Whenever I click "No" on the dialogue ("do you want to install...") the
program freezes. I'm not familiar enough with the code at the minute to know
what's going on. But I will investigate as soon as I can.

My plan was to, for the moment, just put an

if "Ubuntu" in open("/etc/lsb-release").readlines()[0]:

in front of the whole thing, and display an error "The application is not
installed" if not.

I'll let you know as soon as I've cooked up something that works.

  -- Stefano

2011/1/2 Andrew Gee <email address hidden>

> Hi Stefano,
>
> I've got around to reviewing your contribution, finally. Sorry for taking
> so long. The only thing I am hesitant about is if a user would try to run
> gpxviewer on an rpm based distribution. I'm wondering if there's a special
> python module to be able to handle invoking package management across
> platforms. I'm sure another application has had a similar problem before.
>
> Or maybe we should just build in a check for a debian based distribution,
> and throw up a generic error message otherwise?
>
> I'm going to look into it. Let me know if you come up with any ideas or
> thoughts :)
>
> Thanks,
> Andrew
> --
>
> https://code.launchpad.net/~stefano-palazzo/gpxviewer/gpxviewer-null-pub/+merge/40262
> You are the owner of lp:~stefano-palazzo/gpxviewer/gpxviewer-null-pub.
>

Unmerged revisions

82. By Stefano Palazzo

minor cleanup

81. By Stefano Palazzo

open app or show install. dialog even if now file is opened

80. By Stefano Palazzo

added 'do you want to install..?' dalog for when external applications are not installed -- switch from os.spawn() to subprocess.Popen()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: