def main(): try: bot = StratumsphereStatusBot('#stratum0') bot.connection.buffer_class.errors = 'replace' callbacks['send_status'] = bot.send_status jsonserver = JsonServer(('134.169.175.96', 8766)) status.init() jsonserver.start() bot.start() except KeyboardInterrupt: bot.connection.quit("I'm meeeltiiiiiiing!") jsonserver.stop() jsonserver.join()
def __init__(self): locale.setlocale(locale.LC_ALL, '') with open("bot.pid", 'w') as f: f.write(str(os.getpid())) init_logging() status.init() self.login() self.replied_to = replied_to.replied_t("save/replied_to.json") logging.log(logger.DEBUG_ALL, self.replied_to.dict) self.maintain_list = maintain_list_t(self, "save/active_comments.json") stat_parsing.init() item.init() if '-force' in sys.argv: self.maintain_list.flag_for_edits(sys.argv) # Init backlog state. Stream threads will toggle these bools when they # have finished resolving their backlogging, allowing this main thread # to know when its ok to status update. self.backlog = { 'comments': True, 'submissions': True, } self.reply_queue = reply_handler_t(self) self.stream_manager = stream_manager_t(self) # initialize threading event, which will let us pause execution in this # thread whenever we want, and allow a stream subthread to signal to # resume execution self.stream_event = threading.Event() # similarly, make an acm event that main thread can use to signal the # ACM thread to go self.acm_event = threading.Event() if config.debug_memory: self.mem_track = tracker.SummaryTracker()
# 各種リソースのロード init() # スプラッシュの表示 if not skip_splash: if not splash.main(): return False desktop = gui.DesktopWindow(screen.get_size()) header.init() footer.init() mainmenu.init() status.init() volume.init() volume.refresh() domain.init() domain.refresh() options.init() options.refresh() shutdown.init() support.init() back.init()
import wifi wifi.connect() import status status.init() import timer timer.start()
def __init__(self, configuration='./configuration'): status.init() self.config = Path(configuration) self.connector = Connector(self.config)