Skip to content

Commit

Permalink
GH-#192 use load_ipython_extension: merge small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
schettino72 committed Oct 21, 2017
1 parent ce2db36 commit 8e7405d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ Changes
0.31.0 (*unreleased*)
=====================

- Drop Python 3.3 support
- Fix GH-#171 Passing environment variables to CmdAction
- Fix GH-#184 parametrize script name
- Drop Python 3.3 support
- CmdParse now support getting values from OS environment variables
- option `seek_file` control by ENV var `DOIT_SEEK_FILE`
- GH-#192 ipython extension uses `load_ipython_extension`


0.30.3 (*2017-02-20*)
Expand Down
2 changes: 1 addition & 1 deletion doc/tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ First you need to register the new magic function into ipython shell.
(i.e. :file:`~/.ipython/profile_default/startup/doit_magic.ipy`)
with the following content::

from doit.tools import load_ipython_extension
from doit import load_ipython_extension
load_ipython_extension()

Then you can define your `task_creator` functions and invoke them with `%doit`
Expand Down
7 changes: 4 additions & 3 deletions doit/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ def load_ipython_extension(ip=None): # pragma: no cover
(``~/.ipython/profile_default/startup/doit_magic.ipy``) with the
following content:
%load_ext doit.tools
%reload_ext doit.tools
%load_ext doit
%reload_ext doit
%doit list
[1] http://ipython.org/ipython-doc/dev/interactive/tutorial.html#magic-functions
Expand Down Expand Up @@ -293,7 +293,8 @@ def doit(line):
opt_vals = {'dep_file': os.path.join(prof_dir, 'db', '.doit.db')}
commander = DoitMain(ModuleTaskLoader(ip.user_module),
extra_config={'GLOBAL': opt_vals})
commander.BIN_NAME = 'doit'
commander.run(line.split())

# the name register_doit_as_IPython_magic is deprecated on **
# also expose another way of registering ipython extension
register_doit_as_IPython_magic = load_ipython_extension

0 comments on commit 8e7405d

Please sign in to comment.