mgymrek/pybamview — pull request #36 by robinandeer (2014-12-12 11:56:30+00:00)
Title: Use entry points

This is the first step in refactoring pybamview to make use of Flask Blueprints as outlined in #35.

The changes should not affect the CLI usage at all.

Highlights:

1. No more separate script file, everything is contained in the package. The entry point function to the CLI (``pybamview.cli:cli``) is exposed via the entry points system in setuptools (see ``setup.py``). It basically creates an executable that calls the ``cli`` function. This makes managing imports and testing etc. much nicer since the whole code base is in the package.

2. Fewer global variables. I also had to get rid of a few global variables when I setup the CLI entry point function. These config values are now accessible from the ``current_app.config`` dict for the routes which I believe is the Flask standard way of handling these things.