MCPcopy
hub / github.com/InstaPy/InstaPy / end

Method end

instapy/instapy.py:4710–4735  ·  view source on GitHub ↗

Closes the current session

(self, threaded_session: bool = False)

Source from the content-addressed store, hash-verified

4708 return mutual_following
4709
4710 def end(self, threaded_session: bool = False):
4711 """Closes the current session"""
4712
4713 Settings.InstaPy_is_running = False
4714 close_browser(self.browser, threaded_session, self.logger)
4715
4716 with interruption_handler(threaded=threaded_session):
4717 # close virtual display
4718 if self.nogui:
4719 self.display.stop()
4720
4721 # write useful information
4722 dump_follow_restriction(self.username, self.logger, self.logfolder)
4723 dump_record_activity(self.username, self.logger, self.logfolder)
4724
4725 with open("{}followed.txt".format(self.logfolder), "a") as followFile:
4726 followFile.write(
4727 "{:%Y-%m-%d %H:%M} {}\n".format(datetime.now(), self.followed or 0)
4728 )
4729
4730 # output live stats before leaving
4731 self.live_report()
4732
4733 message = "Session ended!"
4734 highlight_print(self.username, message, "end", "info", self.logger)
4735 print("\n\n")
4736
4737 def follow_by_locations(
4738 self,

Callers 1

smart_runFunction · 0.45

Calls 6

live_reportMethod · 0.95
close_browserFunction · 0.85
interruption_handlerFunction · 0.85
dump_follow_restrictionFunction · 0.85
dump_record_activityFunction · 0.85
highlight_printFunction · 0.85

Tested by

no test coverage detected