fix: 暂时禁用实验性功能
This commit is contained in:
@@ -42,6 +42,7 @@ template_dir = "./data/template"
|
|||||||
audio = "playsound" # 可选项: playsound(通用), termux(仅用于支持 Android Termux), mpg123(TODO)
|
audio = "playsound" # 可选项: playsound(通用), termux(仅用于支持 Android Termux), mpg123(TODO)
|
||||||
tts = "edgetts" # 可选项: edgetts
|
tts = "edgetts" # 可选项: edgetts
|
||||||
llm = "openai" # 可选项: openai
|
llm = "openai" # 可选项: openai
|
||||||
|
sync = "webdav" # 可选项: 留空, webdav
|
||||||
|
|
||||||
[providers.tts.edgetts] # EdgeTTS 设置
|
[providers.tts.edgetts] # EdgeTTS 设置
|
||||||
voice = "zh-CN-XiaoxiaoNeural" # 可选项: zh-CN-YunjianNeural (男声), zh-CN-XiaoxiaoNeural (女声)
|
voice = "zh-CN-XiaoxiaoNeural" # 可选项: zh-CN-YunjianNeural (男声), zh-CN-XiaoxiaoNeural (女声)
|
||||||
@@ -50,12 +51,11 @@ voice = "zh-CN-XiaoxiaoNeural" # 可选项: zh-CN-YunjianNeural (男声), zh-CN-
|
|||||||
url = ""
|
url = ""
|
||||||
key = ""
|
key = ""
|
||||||
|
|
||||||
[sync.webdav] # WebDAV 同步设置
|
[providers.sync.webdav] # WebDAV 同步设置
|
||||||
enabled = false
|
|
||||||
url = ""
|
url = ""
|
||||||
username = ""
|
username = ""
|
||||||
password = ""
|
password = ""
|
||||||
remote_path = "/heurams/"
|
remote_path = "/heurams/"
|
||||||
sync_mode = "bidirectional" # bidirectional/upload_only/download_only
|
|
||||||
conflict_strategy = "newer" # newer/ask/keep_both
|
|
||||||
verify_ssl = true
|
verify_ssl = true
|
||||||
|
|
||||||
|
[sync]
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class HeurAMSApp(App):
|
|||||||
("1", "app.push_screen('dashboard')", "仪表盘"),
|
("1", "app.push_screen('dashboard')", "仪表盘"),
|
||||||
("2", "app.push_screen('precache_all')", "缓存管理器"),
|
("2", "app.push_screen('precache_all')", "缓存管理器"),
|
||||||
("3", "app.push_screen('nucleon_creator')", "创建新单元"),
|
("3", "app.push_screen('nucleon_creator')", "创建新单元"),
|
||||||
("4", "app.push_screen('synctool')", "同步工具"),
|
# ("4", "app.push_screen('synctool')", "同步工具"),
|
||||||
("0", "app.push_screen('about')", "版本信息"),
|
("0", "app.push_screen('about')", "版本信息"),
|
||||||
]
|
]
|
||||||
SCREENS = {
|
SCREENS = {
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import pathlib
|
|||||||
from textual.app import ComposeResult
|
from textual.app import ComposeResult
|
||||||
from textual.containers import ScrollableContainer
|
from textual.containers import ScrollableContainer
|
||||||
from textual.screen import Screen
|
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.timer as timer
|
||||||
import heurams.services.version as version
|
import heurams.services.version as version
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import toml
|
|||||||
from textual.app import ComposeResult
|
from textual.app import ComposeResult
|
||||||
from textual.containers import ScrollableContainer
|
from textual.containers import ScrollableContainer
|
||||||
from textual.screen import Screen
|
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.context import config_var
|
||||||
from heurams.services.version import ver
|
from heurams.services.version import ver
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class SyncScreen(Screen):
|
|||||||
def update_ui_from_config(self):
|
def update_ui_from_config(self):
|
||||||
"""更新 UI 显示配置信息"""
|
"""更新 UI 显示配置信息"""
|
||||||
try:
|
try:
|
||||||
sync_cfg: dict = config_var.get()['providers']['sync']['webdav']
|
sync_cfg: dict = config_var.get()["providers"]["sync"]["webdav"]
|
||||||
# 更新服务器 URL
|
# 更新服务器 URL
|
||||||
url = sync_cfg.get("url", "未配置")
|
url = sync_cfg.get("url", "未配置")
|
||||||
url_widget = self.query_one("#server_url")
|
url_widget = self.query_one("#server_url")
|
||||||
|
|||||||
@@ -14,16 +14,9 @@ import pathlib
|
|||||||
from typing import TypedDict
|
from typing import TypedDict
|
||||||
|
|
||||||
from heurams.context import config_var
|
from heurams.context import config_var
|
||||||
from heurams.kernel.algorithms.sm15m_calc import (
|
from heurams.kernel.algorithms.sm15m_calc import (MAX_AF, MIN_AF, NOTCH_AF,
|
||||||
MAX_AF,
|
RANGE_AF, RANGE_REPETITION,
|
||||||
MIN_AF,
|
SM, THRESHOLD_RECALL, Item)
|
||||||
NOTCH_AF,
|
|
||||||
RANGE_AF,
|
|
||||||
RANGE_REPETITION,
|
|
||||||
SM,
|
|
||||||
THRESHOLD_RECALL,
|
|
||||||
Item,
|
|
||||||
)
|
|
||||||
|
|
||||||
# 全局状态文件路径
|
# 全局状态文件路径
|
||||||
_GLOBAL_STATE_FILE = os.path.expanduser(
|
_GLOBAL_STATE_FILE = os.path.expanduser(
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
""" vfs.py
|
"""vfs.py
|
||||||
得益于 FSSpec, 无需实现大部分虚拟文件系统的 Providers
|
得益于 FSSpec, 无需实现大部分虚拟文件系统的 Providers
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import fsspec as fs
|
import fsspec as fs
|
||||||
|
|
||||||
class VFSObject():
|
|
||||||
|
class VFSObject:
|
||||||
def __init__(self, protocol, base_url):
|
def __init__(self, protocol, base_url):
|
||||||
self.base_url = base_url
|
self.base_url = base_url
|
||||||
self.protocol = protocol
|
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):
|
def open(self, path: Path):
|
||||||
return self.fs.open(path)
|
return self.fs.open(path)
|
||||||
|
|
||||||
def open_by_list(self, path_list: list[Path]):
|
def open_by_list(self, path_list: list[Path]):
|
||||||
return self.fs.open_files(path_list)
|
return self.fs.open_files(path_list)
|
||||||
|
|||||||
@@ -10,12 +10,8 @@ from unittest.mock import MagicMock, Mock, patch
|
|||||||
|
|
||||||
from heurams.context import ConfigContext
|
from heurams.context import ConfigContext
|
||||||
from heurams.services.config import ConfigFile
|
from heurams.services.config import ConfigFile
|
||||||
from heurams.services.sync_service import (
|
from heurams.services.sync_service import (ConflictStrategy, SyncConfig,
|
||||||
ConflictStrategy,
|
SyncMode, SyncService)
|
||||||
SyncConfig,
|
|
||||||
SyncMode,
|
|
||||||
SyncService,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class TestSyncServiceUnit(unittest.TestCase):
|
class TestSyncServiceUnit(unittest.TestCase):
|
||||||
@@ -206,7 +202,8 @@ class TestSyncServiceUnit(unittest.TestCase):
|
|||||||
mock_config.data = config_data
|
mock_config.data = config_data
|
||||||
mock_config_var.get.return_value = mock_config
|
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()
|
service = create_sync_service_from_config()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user