fix: 暂时禁用实验性功能

This commit is contained in:
2025-12-21 23:06:17 +08:00
parent ee0646ac79
commit 0fb421412e
8 changed files with 24 additions and 28 deletions

View File

@@ -42,6 +42,7 @@ template_dir = "./data/template"
audio = "playsound" # 可选项: playsound(通用), termux(仅用于支持 Android Termux), mpg123(TODO)
tts = "edgetts" # 可选项: edgetts
llm = "openai" # 可选项: openai
sync = "webdav" # 可选项: 留空, webdav
[providers.tts.edgetts] # EdgeTTS 设置
voice = "zh-CN-XiaoxiaoNeural" # 可选项: zh-CN-YunjianNeural (男声), zh-CN-XiaoxiaoNeural (女声)
@@ -50,12 +51,11 @@ voice = "zh-CN-XiaoxiaoNeural" # 可选项: zh-CN-YunjianNeural (男声), zh-CN-
url = ""
key = ""
[sync.webdav] # WebDAV 同步设置
enabled = false
[providers.sync.webdav] # WebDAV 同步设置
url = ""
username = ""
password = ""
remote_path = "/heurams/"
sync_mode = "bidirectional" # bidirectional/upload_only/download_only
conflict_strategy = "newer" # newer/ask/keep_both
verify_ssl = true
[sync]

View File

@@ -40,7 +40,7 @@ class HeurAMSApp(App):
("1", "app.push_screen('dashboard')", "仪表盘"),
("2", "app.push_screen('precache_all')", "缓存管理器"),
("3", "app.push_screen('nucleon_creator')", "创建新单元"),
("4", "app.push_screen('synctool')", "同步工具"),
# ("4", "app.push_screen('synctool')", "同步工具"),
("0", "app.push_screen('about')", "版本信息"),
]
SCREENS = {

View File

@@ -4,7 +4,8 @@ import pathlib
from textual.app import ComposeResult
from textual.containers import ScrollableContainer
from textual.screen import Screen
from textual.widgets import Button, Footer, Header, Label, ListItem, ListView, Static
from textual.widgets import (Button, Footer, Header, Label, ListItem, ListView,
Static)
import heurams.services.timer as timer
import heurams.services.version as version

View File

@@ -5,7 +5,8 @@ import toml
from textual.app import ComposeResult
from textual.containers import ScrollableContainer
from textual.screen import Screen
from textual.widgets import Button, Footer, Header, Input, Label, Markdown, Select
from textual.widgets import (Button, Footer, Header, Input, Label, Markdown,
Select)
from heurams.context import config_var
from heurams.services.version import ver

View File

@@ -65,7 +65,7 @@ class SyncScreen(Screen):
def update_ui_from_config(self):
"""更新 UI 显示配置信息"""
try:
sync_cfg: dict = config_var.get()['providers']['sync']['webdav']
sync_cfg: dict = config_var.get()["providers"]["sync"]["webdav"]
# 更新服务器 URL
url = sync_cfg.get("url", "未配置")
url_widget = self.query_one("#server_url")

View File

@@ -14,16 +14,9 @@ import pathlib
from typing import TypedDict
from heurams.context import config_var
from heurams.kernel.algorithms.sm15m_calc import (
MAX_AF,
MIN_AF,
NOTCH_AF,
RANGE_AF,
RANGE_REPETITION,
SM,
THRESHOLD_RECALL,
Item,
)
from heurams.kernel.algorithms.sm15m_calc import (MAX_AF, MIN_AF, NOTCH_AF,
RANGE_AF, RANGE_REPETITION,
SM, THRESHOLD_RECALL, Item)
# 全局状态文件路径
_GLOBAL_STATE_FILE = os.path.expanduser(

View File

@@ -1,16 +1,20 @@
""" vfs.py
"""vfs.py
得益于 FSSpec, 无需实现大部分虚拟文件系统的 Providers
"""
from pathlib import Path
import fsspec as fs
class VFSObject():
class VFSObject:
def __init__(self, protocol, base_url):
self.base_url = base_url
self.protocol = protocol
self.fs = fs.filesystem(protocol=protocol, base_url = base_url)
self.fs = fs.filesystem(protocol=protocol, base_url=base_url)
def open(self, path: Path):
return self.fs.open(path)
def open_by_list(self, path_list: list[Path]):
return self.fs.open_files(path_list)

View File

@@ -10,12 +10,8 @@ from unittest.mock import MagicMock, Mock, patch
from heurams.context import ConfigContext
from heurams.services.config import ConfigFile
from heurams.services.sync_service import (
ConflictStrategy,
SyncConfig,
SyncMode,
SyncService,
)
from heurams.services.sync_service import (ConflictStrategy, SyncConfig,
SyncMode, SyncService)
class TestSyncServiceUnit(unittest.TestCase):
@@ -206,7 +202,8 @@ class TestSyncServiceUnit(unittest.TestCase):
mock_config.data = config_data
mock_config_var.get.return_value = mock_config
from heurams.services.sync_service import create_sync_service_from_config
from heurams.services.sync_service import \
create_sync_service_from_config
service = create_sync_service_from_config()