diff --git a/config/deploy.template-cn.yaml b/config/deploy.template-cn.yaml index 4afd7c6..eba0d3f 100644 --- a/config/deploy.template-cn.yaml +++ b/config/deploy.template-cn.yaml @@ -2,7 +2,7 @@ Deploy: Git: # URL of AzurLaneAutoScript repository # [CN user] Use 'cn' to get update from git-over-cdn service - # [Other] Use 'global' to get update from https://github.com/LmeSzinc/StarRailCopilot + # [Other] Use 'global' to get update from https://github.com/TheFunny/ArisuAutoSrcipt Repository: cn # Branch of Alas # [Developer] Use 'dev', 'app', etc, to try new features diff --git a/config/deploy.template.yaml b/config/deploy.template.yaml index cbeee0c..e223420 100644 --- a/config/deploy.template.yaml +++ b/config/deploy.template.yaml @@ -2,7 +2,7 @@ Deploy: Git: # URL of AzurLaneAutoScript repository # [CN user] Use 'cn' to get update from git-over-cdn service - # [Other] Use 'global' to get update from https://github.com/LmeSzinc/StarRailCopilot + # [Other] Use 'global' to get update from https://github.com/TheFunny/ArisuAutoSrcipt Repository: global # Branch of Alas # [Developer] Use 'dev', 'app', etc, to try new features diff --git a/deploy/Windows/git.py b/deploy/Windows/git.py index c873f6b..cbabe60 100644 --- a/deploy/Windows/git.py +++ b/deploy/Windows/git.py @@ -4,7 +4,7 @@ import os from deploy.Windows.config import DeployConfig from deploy.Windows.logger import Progress, logger from deploy.Windows.utils import cached_property -from deploy.git_over_cdn.client import GitOverCdnClient +# from deploy.git_over_cdn.client import GitOverCdnClient class GitConfigParser(configparser.ConfigParser): @@ -17,23 +17,23 @@ class GitConfigParser(configparser.ConfigParser): return False -class GitOverCdnClientWindows(GitOverCdnClient): - def update(self, *args, **kwargs): - Progress.GitInit() - _ = super().update(*args, **kwargs) - Progress.GitShowVersion() - return _ - - @cached_property - def latest_commit(self) -> str: - _ = super().latest_commit - Progress.GitLatestCommit() - return _ - - def download_pack(self): - _ = super().download_pack() - Progress.GitDownloadPack() - return _ +# class GitOverCdnClientWindows(GitOverCdnClient): +# def update(self, *args, **kwargs): +# Progress.GitInit() +# _ = super().update(*args, **kwargs) +# Progress.GitShowVersion() +# return _ +# +# @cached_property +# def latest_commit(self) -> str: +# _ = super().latest_commit +# Progress.GitLatestCommit() +# return _ +# +# def download_pack(self): +# _ = super().download_pack() +# Progress.GitDownloadPack() +# return _ class GitManager(DeployConfig): @@ -128,17 +128,17 @@ class GitManager(DeployConfig): self.execute(f'"{self.git}" --no-pager log --no-merges -1') Progress.GitShowVersion() - @property - def goc_client(self): - client = GitOverCdnClient( - url='https://vip.123pan.cn/1815343254/pack/LmeSzinc_StarRailCopilot_master', - folder=self.root_filepath, - source='origin', - branch='master', - git=self.git, - ) - client.logger = logger - return client + # @property + # def goc_client(self): + # client = GitOverCdnClient( + # url='https://vip.123pan.cn/1815343254/pack/LmeSzinc_StarRailCopilot_master', + # folder=self.root_filepath, + # source='origin', + # branch='master', + # git=self.git, + # ) + # client.logger = logger + # return client def git_install(self): logger.hr('Update Alas', 0) @@ -148,9 +148,9 @@ class GitManager(DeployConfig): Progress.GitShowVersion() return - if self.GitOverCdn: - if self.goc_client.update(keep_changes=self.KeepLocalChanges): - return + # if self.GitOverCdn: + # if self.goc_client.update(keep_changes=self.KeepLocalChanges): + # return self.git_repository_init( repo=self.Repository, diff --git a/deploy/Windows/template.yaml b/deploy/Windows/template.yaml index 045b076..d32f0f2 100644 --- a/deploy/Windows/template.yaml +++ b/deploy/Windows/template.yaml @@ -2,7 +2,7 @@ Deploy: Git: # URL of AzurLaneAutoScript repository # [CN user] Use 'cn' to get update from git-over-cdn service - # [Other] Use 'global' to get update from https://github.com/LmeSzinc/StarRailCopilot + # [Other] Use 'global' to get update from https://github.com/TheFunny/ArisuAutoSrcipt Repository: 'global' # Branch of Alas # [Developer] Use 'dev', 'app', etc, to try new features diff --git a/installer.py b/installer.py new file mode 100644 index 0000000..dc3d5ec --- /dev/null +++ b/installer.py @@ -0,0 +1,55 @@ +import argparse +import sys +import typing as t + +sys.stdout.reconfigure(encoding='utf-8') +sys.stderr.reconfigure(encoding='utf-8') + +""" +Alas installer +""" + + +def run_install(): + from deploy.installer import run + run() + + +def run_print_test(): + from deploy.Windows.installer_test import run + run() + + +def run_set(modify=t.List[str]) -> t.Dict[str, str]: + data = {} + for kv in modify: + if "=" in kv: + key, value = kv.split('=', maxsplit=1) + data[key] = value + + from deploy.set import config_set + return config_set(data) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Alas installer") + parser.add_argument( + "--print-test", + help="To print example installer outputs instead of making an actual installation", + action="store_true", + ) + parser.add_argument( + "--set", + help="Use key=value format to modify config/deploy.yaml\n" + "Example: python installer.py --set Branch=dev", + type=str, + nargs="*", + ) + args, _ = parser.parse_known_args() + + if args.set: + run_set(args.set) + elif args.print_test: + run_print_test() + else: + run_install() diff --git a/module/webui/app.py b/module/webui/app.py index bb3f726..db7e7a5 100644 --- a/module/webui/app.py +++ b/module/webui/app.py @@ -1108,9 +1108,9 @@ class AlasGUI(Frame): # show something put_markdown( """ - SRC is a free open source software, if you paid for SRC from any channel, please refund. - SRC 是一款免费开源软件,如果你在任何渠道付费购买了SRC,请退款。 - Project repository 项目地址:`https://github.com/LmeSzinc/StarRailCopilot` + AAS is a free open source software, if you paid for AAS from any channel, please refund. + AAS 是一款免费开源软件,如果你在任何渠道付费购买了AAS,请退款。 + Project repository 项目地址:`https://github.com/TheFunny/ArisuAutoSrcipt` """ ).style("text-align: center") diff --git a/module/webui/updater.py b/module/webui/updater.py index 5c60b24..a580703 100644 --- a/module/webui/updater.py +++ b/module/webui/updater.py @@ -69,17 +69,17 @@ class Updater(DeployConfig, GitManager, PipManager): def _check_update(self) -> bool: self.state = "checking" - if State.deploy_config.GitOverCdn: - status = self.goc_client.get_status() - if status == "uptodate": - logger.info(f"No update") - return False - elif status == "behind": - logger.info(f"New update available") - return True - else: - # failed, should fallback to `git pull` - pass + # if State.deploy_config.GitOverCdn: + # status = self.goc_client.get_status() + # if status == "uptodate": + # logger.info(f"No update") + # return False + # elif status == "behind": + # logger.info(f"New update available") + # return True + # else: + # # failed, should fallback to `git pull` + # pass source = "origin" for _ in range(3): diff --git a/requirements-in.txt b/requirements-in.txt index 101bf52..255a687 100644 --- a/requirements-in.txt +++ b/requirements-in.txt @@ -31,9 +31,6 @@ starlette==0.14.2 uvicorn[standard]==0.17.6 aiofiles -# Game resources -srcmap==1.1.0 - # For dev # pip-tools pynput diff --git a/requirements.txt b/requirements.txt index 74a129b..d353e9e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -64,7 +64,6 @@ scipy==1.10.1 # via -r requirements-in.txt shapely==2.0.1 # via pponnxcr six==1.16.0 # via pynput, uiautomator2 sniffio==1.3.0 # via anyio -srcmap==1.1.0 # via -r requirements-in.txt starlette==0.14.2 # via -r requirements-in.txt sympy==1.12 # via onnxruntime tornado==6.3.1 # via pywebio diff --git a/webapp/packages/common/utils/getAlasABSPath.ts b/webapp/packages/common/utils/getAlasABSPath.ts index b53897d..763b5b1 100644 --- a/webapp/packages/common/utils/getAlasABSPath.ts +++ b/webapp/packages/common/utils/getAlasABSPath.ts @@ -8,7 +8,7 @@ import fs from 'fs'; */ const getAlasABSPath = ( files: string[] = ['**/config/deploy.yaml', '**/config/deploy.template.yaml'], - rootName: string | string[] = ['AzurLaneAutoScript', 'Alas', 'StarRailCopilot'], + rootName: string | string[] = ['AzurLaneAutoScript', 'Alas', 'ArisuAutoSweeper'], ) => { const path = require('path'); const sep = path.sep; diff --git a/webapp/packages/main/public/deploy.yaml.tpl b/webapp/packages/main/public/deploy.yaml.tpl index b102059..74d9c82 100644 --- a/webapp/packages/main/public/deploy.yaml.tpl +++ b/webapp/packages/main/public/deploy.yaml.tpl @@ -2,7 +2,7 @@ Deploy: Git: # URL of AzurLaneAutoScript repository # [CN user] Use 'cn' to get update from git-over-cdn service - # [Other] Use 'global' to get update from https://github.com/LmeSzinc/StarRailCopilot + # [Other] Use 'global' to get update from https://github.com/TheFunny/ArisuAutoSrcipt Repository: {{repository}} # Branch of Alas # [Developer] Use 'dev', 'app', etc, to try new features