Show More
@@ -116,34 +116,3 b" def locate_profile(profile='default'):" | |||
|
116 | 116 | # IOError makes more sense when people are expecting a path |
|
117 | 117 | raise IOError("Couldn't find profile %r" % profile) |
|
118 | 118 | return pd.location |
|
119 | ||
|
120 | def get_security_file(filename, profile='default'): | |
|
121 | """Return the absolute path of a security file given by filename and profile | |
|
122 | ||
|
123 | This allows users and developers to find security files without | |
|
124 | knowledge of the IPython directory structure. The search path | |
|
125 | will be ['.', profile.security_dir] | |
|
126 | ||
|
127 | Parameters | |
|
128 | ---------- | |
|
129 | ||
|
130 | filename : str | |
|
131 | The file to be found. If it is passed as an absolute path, it will | |
|
132 | simply be returned. | |
|
133 | profile : str [default: 'default'] | |
|
134 | The name of the profile to search. Leaving this unspecified | |
|
135 | The file to be found. If it is passed as an absolute path, fname will | |
|
136 | simply be returned. | |
|
137 | ||
|
138 | Returns | |
|
139 | ------- | |
|
140 | Raises :exc:`IOError` if file not found or returns absolute path to file. | |
|
141 | """ | |
|
142 | # import here, because profiledir also imports from utils.path | |
|
143 | from IPython.core.profiledir import ProfileDir | |
|
144 | try: | |
|
145 | pd = ProfileDir.find_profile_dir_by_name(get_ipython_dir(), profile) | |
|
146 | except Exception: | |
|
147 | # will raise ProfileDirError if no such profile | |
|
148 | raise IOError("Profile %r not found") | |
|
149 | return filefind(filename, ['.', pd.security_dir]) |
@@ -375,13 +375,6 b' def filehash(path):' | |||
|
375 | 375 | with open(path, "rU") as f: |
|
376 | 376 | return md5(py3compat.str_to_bytes(f.read())).hexdigest() |
|
377 | 377 | |
|
378 | @undoc | |
|
379 | def get_security_file(filename, profile='default'): | |
|
380 | warn("get_security_file has moved to the IPython.paths module") | |
|
381 | from IPython.paths import get_security_file | |
|
382 | return get_security_file(filename, profile=profile) | |
|
383 | ||
|
384 | ||
|
385 | 378 | ENOLINK = 1998 |
|
386 | 379 | |
|
387 | 380 | def link(src, dst): |
@@ -20,7 +20,7 b' import zmq' | |||
|
20 | 20 | |
|
21 | 21 | from IPython.kernel.zmq.session import Session |
|
22 | 22 | from IPython.utils.py3compat import str_to_bytes |
|
23 | from IPython.utils.path import get_security_file | |
|
23 | from jupyter_client.connect import find_connection_file | |
|
24 | 24 | |
|
25 | 25 | def main(connection_file): |
|
26 | 26 | """watch iopub channel, and print messages""" |
@@ -73,5 +73,5 b" if __name__ == '__main__':" | |||
|
73 | 73 | cf = sys.argv[1] |
|
74 | 74 | else: |
|
75 | 75 | # This gets the security file for the default profile: |
|
76 |
cf = |
|
|
76 | cf = find_connection_file('ipcontroller-client.json') | |
|
77 | 77 | main(cf) |
General Comments 0
You need to be logged in to leave comments.
Login now