Merge lp://staging/~sinzui/bzr-gtk/fix-threads-icons into lp://staging/bzr-gtk/gtk2

Proposed by Curtis Hovey
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 740
Merged at revision: 738
Proposed branch: lp://staging/~sinzui/bzr-gtk/fix-threads-icons
Merge into: lp://staging/bzr-gtk/gtk2
Diff against target: 268 lines (+110/-21)
6 files modified
avatarproviders.py (+29/-16)
avatarsbox.py (+11/-4)
tests/__init__.py (+1/-0)
tests/test_annotate_config.py (+8/-1)
tests/test_avatarsbox.py (+47/-0)
tests/test_revisionview.py (+14/-0)
To merge this branch: bzr merge lp://staging/~sinzui/bzr-gtk/fix-threads-icons
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) Approve
Review via email: mp+73975@code.staging.launchpad.net

Description of the change

Fix running threads and missing images reported by test suite.

added:
  tests/test_avatarsbox.py
modified:
  avatarproviders.py
  avatarsbox.py
  tests/__init__.py
  tests/test_annotate_config.py
  tests/test_revisionview.py

Setup the window before the working directory is changed, or patch the window
to use a fake implementation of icon_path that know where the icons are.
  tests/test_annotate_config.py
  tests/test_revisionview.py

AvatarDownloaderWorker and its queue were leaving thread behind.
* I refactored the code to just use __stop and removed __end_thread.
* The fix for the worker was to ensure that stop was called during the
  widget's destroy event.
* The queue was troublesome because the worker's run() method was blocking on
  it--join() would never return.
* The fix was to not start the thread until something was queued,
* The stop() method dequeues the avatars so that the queue knows it
  is finished.
* The run() method uses a non-blocking call to something from the queue.
  The loop recovered from the Queue.Empty error.
  avatarproviders.py
  avatarsbox.py
  tests/test_annotate_config.py
  tests/test_revisionview.py

ADDENDUM: The __eq__ method was checking the widget's name attr
(which is always None) instead of the username attr.
  tests/__init__.py
  tests/test_avatarsbox.py
  avatarsbox.py

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Hi Curtis,

Thanks for fixing this. You should be able to land this yourself, now that you're in the ~bzr-gtk team.

review: Approve

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:
to status/vote changes: