Add convenience methods to the avatar registry

Review Request #8203 — Created May 31, 2016 and submitted

Information

Djblets
release-0.10.x

Reviewers

The avatar services registry now provides a convenience method to lookup
an avatar service directly by its avatar service ID (as that is all that
is used), as well as a method to get either the requested service or the
default.

In addition, the get_defaults() method has been refactored to reference
a list of avatar service classes on the registry itself to simplify
subclass implementation.

The enabled_services setter now also computes the sets of avatars
services to disable and enable and disables (or enables) each one
individually.

Ran unit tests.

Description From Last Updated

Should it be possible for this to be called with None? Should we raise a ValueError?

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/avatars/tests.py
        djblets/avatars/registry.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/avatars/tests.py
        djblets/avatars/registry.py
    
    
  2. 
      
david
  1. 
      
  2. djblets/avatars/registry.py (Diff revision 1)
     
     
    Show all issues

    Should it be possible for this to be called with None? Should we raise a ValueError?

    1. The method accepts None intentionally.

  3. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.10.x (37d78d0)