Skip to content

Commit

Permalink
格式化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
Anyk00 committed Sep 7, 2024
1 parent f362e05 commit a7d6f8e
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 18 deletions.
1 change: 1 addition & 0 deletions arknights_mower/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
from datetime import datetime, timedelta

from arknights_mower.solvers.base_schedule import BaseSchedulerSolver
from arknights_mower.solvers.reclamation_algorithm import ReclamationAlgorithm
from arknights_mower.solvers.secret_front import SecretFront
Expand Down
10 changes: 3 additions & 7 deletions arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,19 @@
import os
import pathlib
import sys
import urllib.request
from ctypes import CFUNCTYPE, c_char_p, c_int, c_void_p
from datetime import datetime, timedelta
from typing import Literal

import cv2
import urllib.request

from arknights_mower.data import agent_list, base_room_list
from arknights_mower.solvers.base_mixin import BaseMixin
from arknights_mower.solvers.credit import CreditSolver
from arknights_mower.solvers.credit_fight import CreditFight
from arknights_mower.solvers.cultivate_depot import cultivate as cultivateDepotSolver
from arknights_mower.solvers.depotREC import depotREC as DepotSolver
from arknights_mower.solvers.mail import MailSolver
from arknights_mower.solvers.mission import MissionSolver
from arknights_mower.solvers.navigation import NavigationSolver
from arknights_mower.solvers.operation import OperationSolver
from arknights_mower.solvers.reclamation_algorithm import ReclamationAlgorithm
from arknights_mower.solvers.recruit import RecruitSolver
from arknights_mower.solvers.report import ReportSolver
Expand Down Expand Up @@ -3173,7 +3169,7 @@ def initialize_maa(self):
raise Exception("Maa Python模块导入失败")

try:
logger.debug(f"开始更新Maa活动关卡导航……")
logger.debug("开始更新Maa活动关卡导航……")
ota_tasks_url = (
"https://ota.maa.plus/MaaAssistantArknights/api/resource/tasks.json"
)
Expand All @@ -3183,7 +3179,7 @@ def initialize_maa(self):
res = u.read().decode("utf-8")
with open(ota_tasks_path, "w", encoding="utf-8") as f:
f.write(res)
logger.info(f"Maa活动关卡导航更新成功")
logger.info("Maa活动关卡导航更新成功")
except Exception as e:
logger.error(f"Maa活动关卡导航更新失败:{str(e)}")

Expand Down
5 changes: 2 additions & 3 deletions arknights_mower/solvers/recruit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from arknights_mower.utils.image import cropimg, thres2
from arknights_mower.utils.log import logger
from arknights_mower.utils.recognize import Recognizer, Scene
from arknights_mower.utils.vector import va

with lzma.open(f"{__rootdir__}/models/riic_base_digits.pkl", "rb") as f:
number = pickle.load(f)
Expand Down Expand Up @@ -100,10 +99,10 @@ def run(self):
#return self.agent_choose, self.result_agent

def transition(self) -> bool:
if (scene := self.scene()) == Scene.RECRUIT_MAIN:
if self.scene() == Scene.RECRUIT_MAIN:
if self.recruit_index > 4:
return True
if pos := self.find("recruit/ticket"):
if self.find("recruit/ticket"):
self.ticket_number = self.get_ticket_number()
self.recruit_index=5
'''if self.ticket_number == 0:
Expand Down
1 change: 0 additions & 1 deletion ui/src/components/MaaWeeklyNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const togglePlan = (plan) => {
})
}
const changestage = (plan, newstage) => {
plan['stage'] = newstage
console.log(plan['stage'])
Expand Down
27 changes: 21 additions & 6 deletions ui/src/pages/Log.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function start(value) {
running.value = true
log_lines.value = []
if (value == undefined) {
value = "0"
value = '0'
}
axios.get(`${import.meta.env.VITE_HTTP_URL}/start/${value}`)
get_tasks()
Expand Down Expand Up @@ -101,7 +101,6 @@ const start_options = [
key: '2'
}
]
</script>
<template>
Expand Down Expand Up @@ -136,7 +135,12 @@ const start_options = [
</template>
</tbody>
</n-table>
<n-log class="log" :log="mobile ? log_mobile : log" language="mower" style="user-select: text" />
<n-log
class="log"
:log="mobile ? log_mobile : log"
language="mower"
style="user-select: text"
/>
<div class="action-container">
<drop-down v-if="running" :select="stop_maa" :options="stop_options" type="error" :up="true">
<n-button type="error" @click="stop" :loading="waiting" :disabled="waiting">
Expand All @@ -149,7 +153,13 @@ const start_options = [
</n-button>
</drop-down>
<drop-down v-if="!running" :select="start" :options="start_options" type="primary" :up="true">
<n-button v-if="!running" type="primary" @click="start" :loading="waiting" :disabled="waiting">
<n-button
v-if="!running"
type="primary"
@click="start"
:loading="waiting"
:disabled="waiting"
>
<template #icon>
<n-icon>
<play-icon />
Expand Down Expand Up @@ -183,8 +193,13 @@ const start_options = [
<span class="scroll-label" v-if="!mobile">自动滚动</span>
</div>
</div>
<n-button class="toggle-table-collapse-btn" size="small" @click="show_task_table = !show_task_table"
:focusable="false" v-if="mobile">
<n-button
class="toggle-table-collapse-btn"
size="small"
@click="show_task_table = !show_task_table"
:focusable="false"
v-if="mobile"
>
<template #icon>
<n-icon>
<collapse-icon v-if="show_task_table" />
Expand Down
4 changes: 3 additions & 1 deletion ui/src/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,9 @@ const scene_name = {
<span>菲亚阈值</span>
<help-text>
<div>开启防呆设计时,菲亚只充心情在90%以下的干员,且此处设置无效</div>
<div>不开启防呆设计时,菲亚优先充心情在该阈值以下的干员,若心情均高于该阈值则充心情最低者</div>
<div>
不开启防呆设计时,菲亚优先充心情在该阈值以下的干员,若心情均高于该阈值则充心情最低者
</div>
</help-text>
</template>
<div class="threshold">
Expand Down

0 comments on commit a7d6f8e

Please sign in to comment.