Skip to content

Commit

Permalink
chore: 阿巴阿巴
Browse files Browse the repository at this point in the history
  • Loading branch information
helloplhm-qwq committed Apr 14, 2024
1 parent d6c113c commit 17332fa
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 198 deletions.
8 changes: 4 additions & 4 deletions common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import sys
import sqlite3
import shutil
import ruamel.yaml as yaml
import ruamel.yaml as yaml_
from . import variable
from .log import log
from . import default_config
Expand Down Expand Up @@ -46,7 +46,7 @@ def get_cache_connection():
class ConfigReadException(Exception):
pass


yaml = yaml_.YAML()
default_str = default_config.default
default = yaml.load(default_str)

Expand Down Expand Up @@ -243,7 +243,7 @@ def push_to_list(key, obj):
def write_config(key, value):
config = None
with open('./config/config.yml', 'r', encoding='utf-8') as f:
config = yaml.YAML().load(f)
config = yaml_.YAML().load(f)

keys = key.split('.')
current = config
Expand All @@ -255,7 +255,7 @@ def write_config(key, value):
current[keys[-1]] = value

# 设置保留注释和空行的参数
y = yaml.YAML()
y = yaml_.YAML()
y.preserve_quotes = True
y.preserve_blank_lines = True

Expand Down
Loading

0 comments on commit 17332fa

Please sign in to comment.