Show More
@@ -1,42 +1,42 b'' | |||||
1 | #!/usr/bin/env python |
|
1 | #!/usr/bin/env python | |
2 | # encoding: utf-8 |
|
2 | # encoding: utf-8 | |
3 | """ |
|
3 | """ | |
4 | A backwards compatibility layer for IPython.Shell. |
|
4 | A backwards compatibility layer for IPython.Shell. | |
5 |
|
5 | |||
6 | Previously, IPython had an IPython.Shell module. IPython.Shell has been moved |
|
6 | Previously, IPython had an IPython.Shell module. IPython.Shell has been moved | |
7 | to IPython.core.shell and is being refactored. This new module is provided |
|
7 | to IPython.core.shell and is being refactored. This new module is provided | |
8 | for backwards compatability. We strongly encourage everyone to start using |
|
8 | for backwards compatability. We strongly encourage everyone to start using | |
9 | the new code in IPython.core.shell. |
|
9 | the new code in IPython.core.shell. | |
10 | """ |
|
10 | """ | |
11 |
|
11 | |||
12 | #----------------------------------------------------------------------------- |
|
12 | #----------------------------------------------------------------------------- | |
13 | # Copyright (C) 2008-2009 The IPython Development Team |
|
13 | # Copyright (C) 2008-2009 The IPython Development Team | |
14 | # |
|
14 | # | |
15 | # Distributed under the terms of the BSD License. The full license is in |
|
15 | # Distributed under the terms of the BSD License. The full license is in | |
16 | # the file COPYING, distributed as part of this software. |
|
16 | # the file COPYING, distributed as part of this software. | |
17 | #----------------------------------------------------------------------------- |
|
17 | #----------------------------------------------------------------------------- | |
18 |
|
18 | |||
19 | from warnings import warn |
|
19 | from warnings import warn | |
20 |
|
20 | |||
21 | msg = """ |
|
21 | msg = """ | |
22 | This module (IPython.Shell) is deprecated. The classes that were in this |
|
22 | This module (IPython.Shell) is deprecated. The classes that were in this | |
23 | module have been replaced by: |
|
23 | module have been replaced by: | |
24 |
|
24 | |||
25 | IPShell->IPython.core.iplib.InteractiveShell |
|
25 | IPShell->IPython.core.iplib.InteractiveShell | |
26 | IPShellEmbed->IPython.core.embed.InteractiveShellEmbed |
|
26 | IPShellEmbed->IPython.core.embed.InteractiveShellEmbed | |
27 |
|
27 | |||
28 | Please migrate your code to use these classes instead. |
|
28 | Please migrate your code to use these classes instead. | |
29 | """ |
|
29 | """ | |
30 |
|
30 | |||
31 | warn(msg, category=DeprecationWarning, stacklevel=1) |
|
31 | warn(msg, category=DeprecationWarning, stacklevel=1) | |
32 |
|
32 | |||
33 | from IPython.core.iplib import InteractiveShell as IPShell |
|
33 | from IPython.core.iplib import InteractiveShell as IPShell | |
34 | from IPython.core.embed import InteractiveShellEmbed as IPShellEmbed |
|
34 | from IPython.core.embed import InteractiveShellEmbed as IPShellEmbed | |
35 |
|
35 | |||
36 | def start(user_ns=None, embedded=False): |
|
36 | def start(user_ns=None, embedded=False): | |
37 | """Return an instance of :class:`InteractiveShell`.""" |
|
37 | """Return an instance of :class:`InteractiveShell`.""" | |
38 | if embedded: |
|
38 | if embedded: | |
39 |
return I |
|
39 | return IPShellEmbed(user_ns=user_ns) | |
40 | else: |
|
40 | else: | |
41 |
return I |
|
41 | return IPShell(user_ns=user_ns) | |
42 |
|
42 |
General Comments 0
You need to be logged in to leave comments.
Login now