async def kill(ctx): if isadmin(ctx.message.author): await ctx.send("Shutting down...") shutdown() # sys.exit() else: await ctx.send("You do not have an admin role.")
async def restart_cmd(self, ctx): if platform != "win32": restart() await ctx.send("Restarting...") shutdown() # sys.exit() else: await ctx.send("I cannot do this on Windows.")
async def restart_cmd(self, ctx): e = discord.Embed(color=self.bot.color) if platform != "win32": restart() e.title = "Restarting..." await ctx.send(embed=e) shutdown() else: e.title = "I cannot do this on Windows." await ctx.send(embed=e)
async def restart_cmd(ctx): if isadmin(ctx): if platform != "win32": restart() await ctx.send("Restarting...") shutdown() # sys.exit() else: await ctx.send("I cannot do this on Windows.") else: await ctx.send("You do not have an admin role.")
async def restart_cmd(self, ctx): e = discord.Embed(color=self.bot.color) e.timestamp = datetime.utcnow() e.set_footer(text=self.bot.user.name, icon_url=self.bot.user.avatar_url) if platform != "win32": restart() e.description = "Restarting..." await ctx.send(embed=e) shutdown() else: e.description = "I cannot do this on Windows." await ctx.send(embed=e)
async def update(ctx): if isadmin(ctx): if platform != "win32": await ctx.send("Attempting update...") os.chdir(directory) cmd = os.popen("git fetch") cmd.close() cmd = os.popen("git pull") cmd.close() restart() await ctx.send("Restarting...") shutdown() # sys.exit() else: await ctx.send("I cannot do this on Windows.") else: await ctx.send("You do not have an admin role.")
def test_create_and_run_all_supported_algorithms(self): sys = ActorSystem("multiprocTCPBase", logDefs=log_helper.EVOGIL_LOG_CONFIG) test_cases = run_config.algorithms for test_case in test_cases: with self.subTest(algorithm=test_case): algo_factory, _ = prepare(test_case, "ZDT1") algorithm = algo_factory() simple_simulation = StepsRun(1) result = list( simple_simulation.create_job(algorithm) .pipe(ops.subscribe_on(NewThreadScheduler()), ops.to_iterable()) .run() ) self.assertEqual(1, len(result)) self.assertIsInstance(result[0], ProgressMessage) sys.shutdown()
async def update(ctx): if isadmin(ctx.message.author): if platform != "win32": await ctx.send("Attempting update...") os.chdir(directory) cmd = os.popen("git fetch") cmd.close() cmd = os.popen("git pull") cmd.close() await ctx.send("Creating database backup...") copy(db_file, f"{db_file}.bak") restart() await ctx.send("Restarting...") shutdown() # sys.exit() else: await ctx.send("I cannot do this on Windows.") else: await ctx.send("You do not have an admin role.")
def main(stdscr): curses.curs_set(0) current = State.MAIN_MENU start_settings.loadConfig("general") while True: stdscr.clear() if current == State.MAIN_MENU: current = mainMenu(stdscr) elif current == State.SETTINGS: current = settings(stdscr) elif current == State.CREATE_CFG: current = new_cfg(stdscr) elif current == State.START: if start_settings.get("SAVE_LP") == 1: current = addPassword(stdscr) else: current = State.RUNNING elif current == State.RUNNING: current = spamBody(stdscr) elif current == State.LOADING: current = loader(stdscr) elif current == State.EXIT: shutdown()
async def kill(self, ctx): await ctx.send("Shutting down...") shutdown() # sys.exit()
import sys, os sys.shutdown()