MCPcopy Create free account
hub / github.com/ipython/ipython / run

Method run

IPython/core/history.py:822–837  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

820
821 @needs_sqlite
822 def run(self):
823 # We need a separate db connection per thread:
824 try:
825 self.db = sqlite3.connect(self.history_manager.hist_file,
826 **self.history_manager.connection_options
827 )
828 while True:
829 self.history_manager.save_flag.wait()
830 if self.stop_now:
831 self.db.close()
832 return
833 self.history_manager.save_flag.clear()
834 self.history_manager.writeout_cache(self.db)
835 except Exception as e:
836 print(("The history saving thread hit an unexpected error (%s)."
837 "History will not be written to the database.") % repr(e))
838
839 def stop(self):
840 """This can be called from the main thread to safely stop this thread.

Callers 2

_curio_runnerFunction · 0.45
_trio_runnerFunction · 0.45

Calls 3

waitMethod · 0.80
closeMethod · 0.45
writeout_cacheMethod · 0.45

Tested by

no test coverage detected