Add a RegistryHook base class

Review Request #8530 — Created Nov. 7, 2016 and submitted

Information

Djblets
release-0.10.x

Reviewers

The RegistryHook is a base class that handles registration and
unregistration of items from registries. Subclasses can set the
specific registry to use.

Tests have been added to ensure that the hook correctly registers
items.

  • Ran unit tests.
  • Used this in /r/8531.
Description From Last Updated

Can you add a docstring for this?

daviddavid

Can we call this BaseRegistryHook, since it's not meant to be used directly?

chipx86chipx86

:py:attr:

chipx86chipx86

We should test unregistration too.

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

    Can you add a docstring for this?

  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/extensions/hooks.py
        djblets/extensions/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/extensions/hooks.py
        djblets/extensions/tests.py
    
    
  2. 
      
chipx86
  1. 
      
  2. djblets/extensions/hooks.py (Diff revision 2)
     
     
    Show all issues

    Can we call this BaseRegistryHook, since it's not meant to be used directly?

  3. djblets/extensions/hooks.py (Diff revision 2)
     
     
    Show all issues

    :py:attr:

  4. djblets/extensions/tests.py (Diff revision 2)
     
     
    Show all issues

    We should test unregistration too.

  5. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/extensions/hooks.py
        djblets/extensions/tests.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/extensions/hooks.py
        djblets/extensions/tests.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.10.x (75e5630)