##// END OF EJS Templates
Added new option in %%cython cell magic to specify the module's name.
rossant -
Show More
@@ -147,6 +147,10 b' class CythonMagics(Magics):'
147 "multiple times)."
147 "multiple times)."
148 )
148 )
149 @magic_arguments.argument(
149 @magic_arguments.argument(
150 '-n', '--module_name', action='append', default=[],
151 help="Specify a name for the Cython module."
152 )
153 @magic_arguments.argument(
150 '-L', dest='library_dirs', metavar='dir', action='append', default=[],
154 '-L', dest='library_dirs', metavar='dir', action='append', default=[],
151 help="Add a path to the list of libary directories (can be specified "
155 help="Add a path to the list of libary directories (can be specified "
152 "multiple times)."
156 "multiple times)."
@@ -204,7 +208,10 b' class CythonMagics(Magics):'
204 # key which is hashed to determine the module name.
208 # key which is hashed to determine the module name.
205 key += time.time(),
209 key += time.time(),
206
210
207 module_name = "_cython_magic_" + hashlib.md5(str(key).encode('utf-8')).hexdigest()
211 if args.module_name:
212 module_name = str(args.module_name[0])
213 else:
214 module_name = "_cython_magic_" + hashlib.md5(str(key).encode('utf-8')).hexdigest()
208 module_path = os.path.join(lib_dir, module_name + self.so_ext)
215 module_path = os.path.join(lib_dir, module_name + self.so_ext)
209
216
210 have_module = os.path.isfile(module_path)
217 have_module = os.path.isfile(module_path)
General Comments 0
You need to be logged in to leave comments. Login now