Automatically enable extension dependencies

Review Request #1591 — Created May 14, 2010 and discarded

Information

Djblets
extensions

Reviewers

When extensions are enabled, extension dependencies are enabled.

Two things:

There's code from another review request in here (http://reviews.reviewboard.org/r/1590/) - that would be the extension_list changes, the djblets_extensions.py changes, and change #1 for base.py.  Not entirely sure how to do individual branch changes, and have RB still like it.

 
david
  1. 
      
  2. djblets/extensions/base.py (Diff revision 1)
     
     
    Remove this line.
  3. djblets/extensions/base.py (Diff revision 1)
     
     
     
     
    Indent should be 4 spaces, not 2.
  4. djblets/extensions/base.py (Diff revision 1)
     
     
     
    Indent should be 4 spaces.
  5. 
      
mike_conley
mike_conley
Review request changed
Description:
   

When extensions are enabled, extension dependencies are enabled.

   
   

Two things:

   
~  

1) There's code from another review request in here (http://reviews.reviewboard.org/r/1590/) - that would be the extension_list changes, the djblets_extensions.py changes, and change #1 for base.py. Not entirely sure how to do individual branch changes, and have RB still like it.

  ~

There's code from another review request in here (http://reviews.reviewboard.org/r/1590/) - that would be the extension_list changes, the djblets_extensions.py changes, and change #1 for base.py. Not entirely sure how to do individual branch changes, and have RB still like it.

-  
-  

2) I'm posting this early and without tests as a "sneak preview", just to see if I've got the right idea, or to make early course corrections.

david
  1. Looks good.
  2. 
      
chipx86
  1. 
      
  2. djblets/extensions/base.py (Diff revision 2)
     
     
    If we assume that every requirement is an extension, we're going to run into problems. For example, something that requires ReviewBoard, or Djblets, or RandomPythonPackage. We don't want those to have extension IDs or to be even known about. I think we should just require that extensions very explicitly list their requirements, and default this to [].
    
    If we require this, and we have the names be the extension IDs, then we don't need __id_from_requirement. We can just call enable_extension on the IDs themselves.
  3. djblets/extensions/base.py (Diff revision 2)
     
     
    Can you rename to _get_id_from_requirement?
    
    The _ vs. __ makes a difference when it comes to debugging, as Python may mangle __.
  4. djblets/extensions/base.py (Diff revision 2)
     
     
    This should be imported just once for the whole file, at the top.
  5. djblets/extensions/base.py (Diff revision 2)
     
     
     
    Parameters should be aligned.
  6. Can you indent the {% %} tags the same way as the {% if %} and {% ifhasrequirements %} above?
  7. Can you rename to if_extension_has_requirements ?
  8. Combine these to one line, like:
    
    """Returns blah blah"""
    
    Also, it should have a trailing period.
  9. It'd be best to just return the result of nodelist.render(context) only when needed.
  10.