Show More
@@ -0,0 +1,8 b'' | |||||
|
1 | Functions Removed in 6.x Development cycle | |||
|
2 | ------------------------------------------ | |||
|
3 | ||||
|
4 | The following functions have been removed in the | |||
|
5 | development cycle marked for Milestone 6.0. | |||
|
6 | ||||
|
7 | * IPython/utils/process.py - is_cmd_found | |||
|
8 | * IPython/utils/process.py - pycmd2argv |
@@ -37,9 +37,8 b' def find_cmd(cmd):' | |||||
37 | is a risk you will find the wrong one. Instead find those using the |
|
37 | is a risk you will find the wrong one. Instead find those using the | |
38 | following code and looking for the application itself:: |
|
38 | following code and looking for the application itself:: | |
39 |
|
39 | |||
40 | from IPython.utils.path import get_ipython_module_path |
|
40 | import sys | |
41 | from IPython.utils.process import pycmd2argv |
|
41 | argv = [sys.executable, '-m', 'IPython'] | |
42 | argv = pycmd2argv(get_ipython_module_path('IPython.terminal.ipapp')) |
|
|||
43 |
|
42 | |||
44 | Parameters |
|
43 | Parameters | |
45 | ---------- |
|
44 | ---------- | |
@@ -52,41 +51,6 b' def find_cmd(cmd):' | |||||
52 | return path |
|
51 | return path | |
53 |
|
52 | |||
54 |
|
53 | |||
55 | def is_cmd_found(cmd): |
|
|||
56 | """Check whether executable `cmd` exists or not and return a bool.""" |
|
|||
57 | try: |
|
|||
58 | find_cmd(cmd) |
|
|||
59 | return True |
|
|||
60 | except FindCmdError: |
|
|||
61 | return False |
|
|||
62 |
|
||||
63 |
|
||||
64 | def pycmd2argv(cmd): |
|
|||
65 | r"""Take the path of a python command and return a list (argv-style). |
|
|||
66 |
|
||||
67 | This only works on Python based command line programs and will find the |
|
|||
68 | location of the ``python`` executable using ``sys.executable`` to make |
|
|||
69 | sure the right version is used. |
|
|||
70 |
|
||||
71 | For a given path ``cmd``, this returns [cmd] if cmd's extension is .exe, |
|
|||
72 | .com or .bat, and [, cmd] otherwise. |
|
|||
73 |
|
||||
74 | Parameters |
|
|||
75 | ---------- |
|
|||
76 | cmd : string |
|
|||
77 | The path of the command. |
|
|||
78 |
|
||||
79 | Returns |
|
|||
80 | ------- |
|
|||
81 | argv-style list. |
|
|||
82 | """ |
|
|||
83 | ext = os.path.splitext(cmd)[1] |
|
|||
84 | if ext in ['.exe', '.com', '.bat']: |
|
|||
85 | return [cmd] |
|
|||
86 | else: |
|
|||
87 | return [sys.executable, cmd] |
|
|||
88 |
|
||||
89 |
|
||||
90 | def abbrev_cwd(): |
|
54 | def abbrev_cwd(): | |
91 | """ Return abbreviated version of cwd, e.g. d:mydir """ |
|
55 | """ Return abbreviated version of cwd, e.g. d:mydir """ | |
92 | cwd = py3compat.getcwd().replace('\\','/') |
|
56 | cwd = py3compat.getcwd().replace('\\','/') |
General Comments 0
You need to be logged in to leave comments.
Login now