A script for migrating extension import syntax.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
flask_ext_migrate Use generator to load filenames lazily Aug 22, 2016
tests Add directory CLI tests Aug 22, 2016
.gitignore Add pytest cache dir to gitignore Aug 22, 2016
.travis.yml Remove 2.6/3.3 builds from CI, no flake8 support Aug 21, 2016
AUTHORS Add AUTHORS Aug 21, 2016
LICENSE
README.rst
setup.py
tox.ini

README.rst

flask_ext_migrate: import migration tool

This package allows for rapid fixing of old style Flask extension imports from the format flask.ext.foo to flask_foo. It also repairs any associated function calls. Although this tool has been tested extensively always check the output file to ensure correct functionality.

Installation

To install, simply:

$ pip install flask_ext_migrate

Usage

$ flask_ext_migrate --help
usage: flask_ext_migrate <INPUT_SOURCE>

A source code migration tool for converting extension imports.
--------------------------------------------------------------------------
https://github.com/pocoo/flask-ext-migrate

required arguments:
  <INPUT_SOURCE>     Either a single file or directory to be recursively converted

optional arguments:
  --help             Show this help message and exit

For example to convert the imports in a file app.py use:

$ flask_ext_migrate app.py

To convert all imports in all files within the directory app/ (relative path) use:

$ flask_ext_migrate app

# This also works.
$ flask_ext_migrate app/