upstart-monitor cannot run without gtk libraries installed
Bug #1235245 reported by
James Hunt
This bug affects 8 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
New
|
Undecided
|
Cameron Norman | ||
upstart (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
"upstart-monitor -n" should revert to cli operation. It attempts to do this, but then barfs on class UpstartEventsGu
To post a comment you must log in.
I took a quick look at lp:upstart and it shouldn't be too hard to fix this. There are several classic approaches to doing this, but I think the easiest way is to simply move UpstartEventsGui into a separate module which only gets imported in the `else` clause at the bottom of main(). That's the only reference to this class, and by then you know you have Gtk. Yes, it's perfectly fine to embed an import right there:
...
else:
from .upstart_gui import UpstartEventsGui
win = UpstartEventsGui()
(then you'd move UpstartEventsGui to upstart_gui.py in that directory.)