##// END OF EJS Templates
_ip.load runs init_ipython even if the module already exists
vivainio -
Show More
@@ -183,6 +183,7 b' class IPApi:'
183 183 # The ipython instance provided
184 184 self.IP = ip
185 185
186 self.extensions = {}
186 187 global _recent
187 188 _recent = self
188 189
@@ -380,12 +381,18 b' class IPApi:'
380 381 self.IP.rl_next_input = s
381 382
382 383 def load(self, mod):
383 if mod in sys.modules:
384 return
384 if mod in self.extensions:
385 # just to make sure we don't init it twice
386 # note that if you 'load' a module that has already been
387 # imported, init_ipython gets run anyway
388
389 return self.extensions[mod]
385 390 __import__(mod)
386 391 m = sys.modules[mod]
387 392 if hasattr(m,'init_ipython'):
388 393 m.init_ipython(self)
394 self.extensions[mod] = m
395 return m
389 396
390 397
391 398 def launch_new_instance(user_ns = None):
General Comments 0
You need to be logged in to leave comments. Login now