1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2025-12-16 02:35:12 +00:00

fix: Adapt for AAS

This commit is contained in:
YoursFunny 2023-11-01 17:04:20 +08:00
parent 6860f2eb72
commit 3c4c9a6d61
Signed by: YoursFunny
GPG Key ID: 207EDC3CD5B40F9C
11 changed files with 106 additions and 55 deletions

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

55
installer.py Normal file
View File

@ -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()

View File

@ -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")

View File

@ -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):

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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