Created a new script for generating scaffolding for new extensions.

Review Request #2830 — Created Jan. 28, 2012 and submitted

Information

Review Board

Reviewers

Created a new script for generating scaffolding for new extensions.

Previous code review: http://reviews.reviewboard.org/r/2822/
I added some unit tests for naming convention testing and conversion, but otherwise all testing has been manual on Linux 3.1.8-1.
I have tried creating new extensions with each option, and installing the egg using easy_install name develop on a local environment.
Description From Last Updated

change option name to --package-name.

BA bartek

The dashboard_link variable appears to be bool. If so, add action='store_true'.

BA bartek

contrib/tools/templates/extensions/extension/extension.py:28:1: E112 expected an indented block

CI cim1

contrib/tools/templates/extensions/extension/extension.py:38:1: W391 blank line at end of file

CI cim1

contrib/tools/templates/extensions/extension/views.py:14:1: W391 blank line at end of file

CI cim1

contrib/tools/templates/extensions/setup.py:26:1: W391 blank line at end of file

CI cim1

I don't think this should go here as AFAIK contrib scripts are not installed so the dependency does not make …

BA bartek
AM
BA
  1. 
      
  2. contrib/tools/generate_extension.py (Diff revision 2)
     
     
     
     
     
    Show all issues
    The dashboard_link variable appears to be bool. If so, add action='store_true'.
    1. I should change the help description to make it more clear, but this lets you set the name of the dashboard link which will indicate to the script that it should create the link.
    2. Ah, missed it in template somehow. You can add 'metavar="LABEL"' in that case, which should be readable enough.
  3. setup.py (Diff revision 2)
     
     
    Show all issues
    I don't think this should go here as AFAIK contrib scripts are not installed so the dependency does not make sense
  4. 
      
CI
  1. Ran your code through PEP8.
  2. Show all issues
    contrib/tools/templates/extensions/extension/extension.py:28:1: E112 expected an indented block
    1. Since these aren't exactly python scripts, but rather templates, I thought that doing proper indentation with the template blocks would make it difficult to generate proper python files.
  3. Show all issues
    contrib/tools/templates/extensions/extension/extension.py:38:1: W391 blank line at end of file
    1. I added this to counteract the W292 (no newline at end of file) on the generated files as Jinja2 automatically removes one newline.
  4. Show all issues
    contrib/tools/templates/extensions/extension/views.py:14:1: W391 blank line at end of file
  5. Show all issues
    contrib/tools/templates/extensions/setup.py:26:1: W391 blank line at end of file
  6. 
      
BA
  1. 
      
  2. contrib/tools/generate_extension.py (Diff revision 2)
     
     
    Show all issues
    change option name to --package-name.
  3. 
      
AM
mike_conley
  1. This looks good to me - thanks Anthony!
    
    -Mike
  2. 
      
AM
Review request changed
Status:
Completed
Change Summary:
Landed as 8d4e68c072.  Thanks!