Merge lp:~pitti/gtimelog/pygi into lp:~gtimelog-dev/gtimelog/trunk

Proposed by Martin Pitt
Status: Merged
Merge reported by: Marius Gedminas
Merged at revision: not available
Proposed branch: lp:~pitti/gtimelog/pygi
Merge into: lp:~gtimelog-dev/gtimelog/trunk
Diff against target: 30 lines (+3/-3)
1 file modified
src/gtimelog/main.py (+3/-3)
To merge this branch: bzr merge lp:~pitti/gtimelog/pygi
Reviewer Review Type Date Requested Status
Marius Gedminas Approve
Review via email: mp+48327@code.launchpad.net

Description of the change

This fixes a regression from r183, which caused a startup failure if appindicator is available:

Traceback (most recent call last):
  File "./gtimelog", line 12, in <module>
    main()
  File "./src/gtimelog/main.py", line 2041, in main
    tray_icon = icon_class(main_window)
  File "./src/gtimelog/main.py", line 1124, in __init__
    if appindicator is None:
NameError: global name 'appindicator' is not defined

To post a comment you must log in.
Revision history for this message
Marius Gedminas (mgedmin) wrote :

Thanks a lot!

review: Approve
lp:~pitti/gtimelog/pygi updated
186. By Marius Gedminas

Fix crash on startup if PyGTK is not available, but PyGI and appindicator are.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/gtimelog/main.py'
2--- src/gtimelog/main.py 2011-01-31 21:58:30 +0000
3+++ src/gtimelog/main.py 2011-02-02 15:08:06 +0000
4@@ -38,7 +38,7 @@
5 APPINDICATOR_ACTIVE = appindicator.STATUS_ACTIVE
6 except ImportError:
7 # apt-get install python-appindicator on Ubuntu
8- appindicator = None
9+ new_app_indicator = None
10
11 except ImportError:
12 import gi
13@@ -60,7 +60,7 @@
14 APPINDICATOR_CATEGORY = AppIndicator.IndicatorCategory.APPLICATION_STATUS
15 APPINDICATOR_ACTIVE = AppIndicator.IndicatorStatus.ACTIVE
16 except (ImportError, gi._gi.RepositoryError):
17- appindicator = None
18+ new_app_indicator = None
19
20 try:
21 import dbus
22@@ -1120,7 +1120,7 @@
23 self.gtimelog_window = gtimelog_window
24 self.timelog = gtimelog_window.timelog
25 self.indicator = None
26- if appindicator is None:
27+ if new_app_indicator is None:
28 return
29 self.indicator = new_app_indicator("gtimelog", self.icon_name,
30 APPINDICATOR_CATEGORY)

Subscribers

People subscribed via source and target branches