Show More
@@ -11,7 +11,6 b' import sys' | |||||
11 | import errno |
|
11 | import errno | |
12 | import shutil |
|
12 | import shutil | |
13 | import random |
|
13 | import random | |
14 | import tempfile |
|
|||
15 | import glob |
|
14 | import glob | |
16 | from warnings import warn |
|
15 | from warnings import warn | |
17 | from hashlib import md5 |
|
16 | from hashlib import md5 | |
@@ -78,7 +77,7 b" def unquote_filename(name, win32=(sys.platform=='win32')):" | |||||
78 | unquoting is now taken care of by :func:`IPython.utils.process.arg_split`. |
|
77 | unquoting is now taken care of by :func:`IPython.utils.process.arg_split`. | |
79 | """ |
|
78 | """ | |
80 | warn("'unquote_filename' is deprecated since IPython 5.0 and should not " |
|
79 | warn("'unquote_filename' is deprecated since IPython 5.0 and should not " | |
81 | "be used anymore", DeprecationWarning) |
|
80 | "be used anymore", DeprecationWarning, stacklevel=2) | |
82 | if win32: |
|
81 | if win32: | |
83 | if name.startswith(("'", '"')) and name.endswith(("'", '"')): |
|
82 | if name.startswith(("'", '"')) and name.endswith(("'", '"')): | |
84 | name = name[1:-1] |
|
83 | name = name[1:-1] | |
@@ -105,7 +104,7 b' def get_py_filename(name, force_win32=None):' | |||||
105 | if force_win32 is not None: |
|
104 | if force_win32 is not None: | |
106 | warn("The 'force_win32' argument to 'get_py_filename' is deprecated " |
|
105 | warn("The 'force_win32' argument to 'get_py_filename' is deprecated " | |
107 | "since IPython 5.0 and should not be used anymore", |
|
106 | "since IPython 5.0 and should not be used anymore", | |
108 | DeprecationWarning) |
|
107 | DeprecationWarning, stacklevel=2) | |
109 | if not os.path.isfile(name) and not name.endswith('.py'): |
|
108 | if not os.path.isfile(name) and not name.endswith('.py'): | |
110 | name += '.py' |
|
109 | name += '.py' | |
111 | if os.path.isfile(name): |
|
110 | if os.path.isfile(name): | |
@@ -256,31 +255,31 b' def get_xdg_cache_dir():' | |||||
256 |
|
255 | |||
257 | @undoc |
|
256 | @undoc | |
258 | def get_ipython_dir(): |
|
257 | def get_ipython_dir(): | |
259 | warn("get_ipython_dir has moved to the IPython.paths module") |
|
258 | warn("get_ipython_dir has moved to the IPython.paths module since IPython 4.0.", stacklevel=2) | |
260 | from IPython.paths import get_ipython_dir |
|
259 | from IPython.paths import get_ipython_dir | |
261 | return get_ipython_dir() |
|
260 | return get_ipython_dir() | |
262 |
|
261 | |||
263 | @undoc |
|
262 | @undoc | |
264 | def get_ipython_cache_dir(): |
|
263 | def get_ipython_cache_dir(): | |
265 | warn("get_ipython_cache_dir has moved to the IPython.paths module") |
|
264 | warn("get_ipython_cache_dir has moved to the IPython.paths module since IPython 4.0.", stacklevel=2) | |
266 | from IPython.paths import get_ipython_cache_dir |
|
265 | from IPython.paths import get_ipython_cache_dir | |
267 | return get_ipython_cache_dir() |
|
266 | return get_ipython_cache_dir() | |
268 |
|
267 | |||
269 | @undoc |
|
268 | @undoc | |
270 | def get_ipython_package_dir(): |
|
269 | def get_ipython_package_dir(): | |
271 | warn("get_ipython_package_dir has moved to the IPython.paths module") |
|
270 | warn("get_ipython_package_dir has moved to the IPython.paths module since IPython 4.0.", stacklevel=2) | |
272 | from IPython.paths import get_ipython_package_dir |
|
271 | from IPython.paths import get_ipython_package_dir | |
273 | return get_ipython_package_dir() |
|
272 | return get_ipython_package_dir() | |
274 |
|
273 | |||
275 | @undoc |
|
274 | @undoc | |
276 | def get_ipython_module_path(module_str): |
|
275 | def get_ipython_module_path(module_str): | |
277 | warn("get_ipython_module_path has moved to the IPython.paths module") |
|
276 | warn("get_ipython_module_path has moved to the IPython.paths module since IPython 4.0.", stacklevel=2) | |
278 | from IPython.paths import get_ipython_module_path |
|
277 | from IPython.paths import get_ipython_module_path | |
279 | return get_ipython_module_path(module_str) |
|
278 | return get_ipython_module_path(module_str) | |
280 |
|
279 | |||
281 | @undoc |
|
280 | @undoc | |
282 | def locate_profile(profile='default'): |
|
281 | def locate_profile(profile='default'): | |
283 | warn("locate_profile has moved to the IPython.paths module") |
|
282 | warn("locate_profile has moved to the IPython.paths module since IPython 4.0.", stacklevel=2) | |
284 | from IPython.paths import locate_profile |
|
283 | from IPython.paths import locate_profile | |
285 | return locate_profile(profile=profile) |
|
284 | return locate_profile(profile=profile) | |
286 |
|
285 | |||
@@ -371,7 +370,7 b' def target_update(target,deps,cmd):' | |||||
371 | def filehash(path): |
|
370 | def filehash(path): | |
372 | """Make an MD5 hash of a file, ignoring any differences in line |
|
371 | """Make an MD5 hash of a file, ignoring any differences in line | |
373 | ending characters.""" |
|
372 | ending characters.""" | |
374 | warn("filehash() is deprecated") |
|
373 | warn("filehash() is deprecated since IPython 4.0", DeprecationWarning, stacklevel=2) | |
375 | with open(path, "rU") as f: |
|
374 | with open(path, "rU") as f: | |
376 | return md5(py3compat.str_to_bytes(f.read())).hexdigest() |
|
375 | return md5(py3compat.str_to_bytes(f.read())).hexdigest() | |
377 |
|
376 |
General Comments 0
You need to be logged in to leave comments.
Login now