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
=== modified file 'src/gtimelog/main.py'
--- src/gtimelog/main.py 2011-01-31 21:58:30 +0000
+++ src/gtimelog/main.py 2011-02-02 15:08:06 +0000
@@ -38,7 +38,7 @@
38 APPINDICATOR_ACTIVE = appindicator.STATUS_ACTIVE38 APPINDICATOR_ACTIVE = appindicator.STATUS_ACTIVE
39 except ImportError:39 except ImportError:
40 # apt-get install python-appindicator on Ubuntu40 # apt-get install python-appindicator on Ubuntu
41 appindicator = None41 new_app_indicator = None
4242
43except ImportError:43except ImportError:
44 import gi44 import gi
@@ -60,7 +60,7 @@
60 APPINDICATOR_CATEGORY = AppIndicator.IndicatorCategory.APPLICATION_STATUS60 APPINDICATOR_CATEGORY = AppIndicator.IndicatorCategory.APPLICATION_STATUS
61 APPINDICATOR_ACTIVE = AppIndicator.IndicatorStatus.ACTIVE61 APPINDICATOR_ACTIVE = AppIndicator.IndicatorStatus.ACTIVE
62 except (ImportError, gi._gi.RepositoryError):62 except (ImportError, gi._gi.RepositoryError):
63 appindicator = None63 new_app_indicator = None
6464
65try:65try:
66 import dbus66 import dbus
@@ -1120,7 +1120,7 @@
1120 self.gtimelog_window = gtimelog_window1120 self.gtimelog_window = gtimelog_window
1121 self.timelog = gtimelog_window.timelog1121 self.timelog = gtimelog_window.timelog
1122 self.indicator = None1122 self.indicator = None
1123 if appindicator is None:1123 if new_app_indicator is None:
1124 return1124 return
1125 self.indicator = new_app_indicator("gtimelog", self.icon_name,1125 self.indicator = new_app_indicator("gtimelog", self.icon_name,
1126 APPINDICATOR_CATEGORY)1126 APPINDICATOR_CATEGORY)

Subscribers

People subscribed via source and target branches