mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2025-12-17 02:25:12 +00:00
fix: Adapt for AAS
This commit is contained in:
parent
6860f2eb72
commit
3c4c9a6d61
@ -2,7 +2,7 @@ Deploy:
|
|||||||
Git:
|
Git:
|
||||||
# URL of AzurLaneAutoScript repository
|
# URL of AzurLaneAutoScript repository
|
||||||
# [CN user] Use 'cn' to get update from git-over-cdn service
|
# [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
|
Repository: cn
|
||||||
# Branch of Alas
|
# Branch of Alas
|
||||||
# [Developer] Use 'dev', 'app', etc, to try new features
|
# [Developer] Use 'dev', 'app', etc, to try new features
|
||||||
|
|||||||
@ -2,7 +2,7 @@ Deploy:
|
|||||||
Git:
|
Git:
|
||||||
# URL of AzurLaneAutoScript repository
|
# URL of AzurLaneAutoScript repository
|
||||||
# [CN user] Use 'cn' to get update from git-over-cdn service
|
# [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
|
Repository: global
|
||||||
# Branch of Alas
|
# Branch of Alas
|
||||||
# [Developer] Use 'dev', 'app', etc, to try new features
|
# [Developer] Use 'dev', 'app', etc, to try new features
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import os
|
|||||||
from deploy.Windows.config import DeployConfig
|
from deploy.Windows.config import DeployConfig
|
||||||
from deploy.Windows.logger import Progress, logger
|
from deploy.Windows.logger import Progress, logger
|
||||||
from deploy.Windows.utils import cached_property
|
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):
|
class GitConfigParser(configparser.ConfigParser):
|
||||||
@ -17,23 +17,23 @@ class GitConfigParser(configparser.ConfigParser):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class GitOverCdnClientWindows(GitOverCdnClient):
|
# class GitOverCdnClientWindows(GitOverCdnClient):
|
||||||
def update(self, *args, **kwargs):
|
# def update(self, *args, **kwargs):
|
||||||
Progress.GitInit()
|
# Progress.GitInit()
|
||||||
_ = super().update(*args, **kwargs)
|
# _ = super().update(*args, **kwargs)
|
||||||
Progress.GitShowVersion()
|
# Progress.GitShowVersion()
|
||||||
return _
|
# return _
|
||||||
|
#
|
||||||
@cached_property
|
# @cached_property
|
||||||
def latest_commit(self) -> str:
|
# def latest_commit(self) -> str:
|
||||||
_ = super().latest_commit
|
# _ = super().latest_commit
|
||||||
Progress.GitLatestCommit()
|
# Progress.GitLatestCommit()
|
||||||
return _
|
# return _
|
||||||
|
#
|
||||||
def download_pack(self):
|
# def download_pack(self):
|
||||||
_ = super().download_pack()
|
# _ = super().download_pack()
|
||||||
Progress.GitDownloadPack()
|
# Progress.GitDownloadPack()
|
||||||
return _
|
# return _
|
||||||
|
|
||||||
|
|
||||||
class GitManager(DeployConfig):
|
class GitManager(DeployConfig):
|
||||||
@ -128,17 +128,17 @@ class GitManager(DeployConfig):
|
|||||||
self.execute(f'"{self.git}" --no-pager log --no-merges -1')
|
self.execute(f'"{self.git}" --no-pager log --no-merges -1')
|
||||||
Progress.GitShowVersion()
|
Progress.GitShowVersion()
|
||||||
|
|
||||||
@property
|
# @property
|
||||||
def goc_client(self):
|
# def goc_client(self):
|
||||||
client = GitOverCdnClient(
|
# client = GitOverCdnClient(
|
||||||
url='https://vip.123pan.cn/1815343254/pack/LmeSzinc_StarRailCopilot_master',
|
# url='https://vip.123pan.cn/1815343254/pack/LmeSzinc_StarRailCopilot_master',
|
||||||
folder=self.root_filepath,
|
# folder=self.root_filepath,
|
||||||
source='origin',
|
# source='origin',
|
||||||
branch='master',
|
# branch='master',
|
||||||
git=self.git,
|
# git=self.git,
|
||||||
)
|
# )
|
||||||
client.logger = logger
|
# client.logger = logger
|
||||||
return client
|
# return client
|
||||||
|
|
||||||
def git_install(self):
|
def git_install(self):
|
||||||
logger.hr('Update Alas', 0)
|
logger.hr('Update Alas', 0)
|
||||||
@ -148,9 +148,9 @@ class GitManager(DeployConfig):
|
|||||||
Progress.GitShowVersion()
|
Progress.GitShowVersion()
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.GitOverCdn:
|
# if self.GitOverCdn:
|
||||||
if self.goc_client.update(keep_changes=self.KeepLocalChanges):
|
# if self.goc_client.update(keep_changes=self.KeepLocalChanges):
|
||||||
return
|
# return
|
||||||
|
|
||||||
self.git_repository_init(
|
self.git_repository_init(
|
||||||
repo=self.Repository,
|
repo=self.Repository,
|
||||||
|
|||||||
@ -2,7 +2,7 @@ Deploy:
|
|||||||
Git:
|
Git:
|
||||||
# URL of AzurLaneAutoScript repository
|
# URL of AzurLaneAutoScript repository
|
||||||
# [CN user] Use 'cn' to get update from git-over-cdn service
|
# [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'
|
Repository: 'global'
|
||||||
# Branch of Alas
|
# Branch of Alas
|
||||||
# [Developer] Use 'dev', 'app', etc, to try new features
|
# [Developer] Use 'dev', 'app', etc, to try new features
|
||||||
|
|||||||
55
installer.py
Normal file
55
installer.py
Normal 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()
|
||||||
@ -1108,9 +1108,9 @@ class AlasGUI(Frame):
|
|||||||
# show something
|
# show something
|
||||||
put_markdown(
|
put_markdown(
|
||||||
"""
|
"""
|
||||||
SRC is a free open source software, if you paid for SRC from any channel, please refund.
|
AAS is a free open source software, if you paid for AAS from any channel, please refund.
|
||||||
SRC 是一款免费开源软件,如果你在任何渠道付费购买了SRC,请退款。
|
AAS 是一款免费开源软件,如果你在任何渠道付费购买了AAS,请退款。
|
||||||
Project repository 项目地址:`https://github.com/LmeSzinc/StarRailCopilot`
|
Project repository 项目地址:`https://github.com/TheFunny/ArisuAutoSrcipt`
|
||||||
"""
|
"""
|
||||||
).style("text-align: center")
|
).style("text-align: center")
|
||||||
|
|
||||||
|
|||||||
@ -69,17 +69,17 @@ class Updater(DeployConfig, GitManager, PipManager):
|
|||||||
def _check_update(self) -> bool:
|
def _check_update(self) -> bool:
|
||||||
self.state = "checking"
|
self.state = "checking"
|
||||||
|
|
||||||
if State.deploy_config.GitOverCdn:
|
# if State.deploy_config.GitOverCdn:
|
||||||
status = self.goc_client.get_status()
|
# status = self.goc_client.get_status()
|
||||||
if status == "uptodate":
|
# if status == "uptodate":
|
||||||
logger.info(f"No update")
|
# logger.info(f"No update")
|
||||||
return False
|
# return False
|
||||||
elif status == "behind":
|
# elif status == "behind":
|
||||||
logger.info(f"New update available")
|
# logger.info(f"New update available")
|
||||||
return True
|
# return True
|
||||||
else:
|
# else:
|
||||||
# failed, should fallback to `git pull`
|
# # failed, should fallback to `git pull`
|
||||||
pass
|
# pass
|
||||||
|
|
||||||
source = "origin"
|
source = "origin"
|
||||||
for _ in range(3):
|
for _ in range(3):
|
||||||
|
|||||||
@ -31,9 +31,6 @@ starlette==0.14.2
|
|||||||
uvicorn[standard]==0.17.6
|
uvicorn[standard]==0.17.6
|
||||||
aiofiles
|
aiofiles
|
||||||
|
|
||||||
# Game resources
|
|
||||||
srcmap==1.1.0
|
|
||||||
|
|
||||||
# For dev
|
# For dev
|
||||||
# pip-tools
|
# pip-tools
|
||||||
pynput
|
pynput
|
||||||
|
|||||||
@ -64,7 +64,6 @@ scipy==1.10.1 # via -r requirements-in.txt
|
|||||||
shapely==2.0.1 # via pponnxcr
|
shapely==2.0.1 # via pponnxcr
|
||||||
six==1.16.0 # via pynput, uiautomator2
|
six==1.16.0 # via pynput, uiautomator2
|
||||||
sniffio==1.3.0 # via anyio
|
sniffio==1.3.0 # via anyio
|
||||||
srcmap==1.1.0 # via -r requirements-in.txt
|
|
||||||
starlette==0.14.2 # via -r requirements-in.txt
|
starlette==0.14.2 # via -r requirements-in.txt
|
||||||
sympy==1.12 # via onnxruntime
|
sympy==1.12 # via onnxruntime
|
||||||
tornado==6.3.1 # via pywebio
|
tornado==6.3.1 # via pywebio
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import fs from 'fs';
|
|||||||
*/
|
*/
|
||||||
const getAlasABSPath = (
|
const getAlasABSPath = (
|
||||||
files: string[] = ['**/config/deploy.yaml', '**/config/deploy.template.yaml'],
|
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 path = require('path');
|
||||||
const sep = path.sep;
|
const sep = path.sep;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ Deploy:
|
|||||||
Git:
|
Git:
|
||||||
# URL of AzurLaneAutoScript repository
|
# URL of AzurLaneAutoScript repository
|
||||||
# [CN user] Use 'cn' to get update from git-over-cdn service
|
# [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}}
|
Repository: {{repository}}
|
||||||
# Branch of Alas
|
# Branch of Alas
|
||||||
# [Developer] Use 'dev', 'app', etc, to try new features
|
# [Developer] Use 'dev', 'app', etc, to try new features
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user