MCPcopy Create free account
hub / github.com/MCSLTeam/MCSL2 / saveRunScript

Method saveRunScript

MCSL2Lib/ServerControllers/windowCreator.py:905–925  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

903 w.show()
904
905 def saveRunScript(self):
906 try:
907 writeFile(
908 QFileDialog.getSaveFileName(
909 self,
910 self.tr("MCSL2 服务器 - 保存启动脚本"),
911 f"Run {self.serverConfig.serverName}.ps1",
912 "Powershell 脚本(*.ps1)",
913 )[0],
914 self.genRunScript(save=True),
915 )
916 except FileNotFoundError:
917 InfoBar.warning(
918 self.tr("提示"),
919 self.tr("已取消保存启动脚本"),
920 orient=Qt.Horizontal,
921 isClosable=True,
922 position=InfoBarPosition.TOP,
923 duration=1500,
924 parent=self,
925 )
926
927 def initSafelyQuitController(self):
928 # 安全退出控件

Callers

nothing calls this directly

Calls 3

genRunScriptMethod · 0.95
writeFileFunction · 0.90
warningMethod · 0.80

Tested by

no test coverage detected