1
0
forked from bot/app
LiteyukiBot/assets/config.html-yG22ZQgb.js

4 lines
9.6 KiB
JavaScript
Raw Normal View History

import{_ as o,o as n,c as i,b as e,d as a,e as t}from"./app-ClSKFI0Z.js";const r={},d=e("h3",{id:"def-flat-config-config-dict-str-any-dict-str-any",tabindex:"-1"},[e("a",{class:"header-anchor",href:"#def-flat-config-config-dict-str-any-dict-str-any"},[e("span",null,[e("em",null,[e("strong",null,"def")]),a(),e("code",null,"flat_config(config: dict[str, Any]) -> dict[str, Any]")])])],-1),c=e("p",null,"扁平化配置文件",-1),l=e("p",{"a.b.c:1":""},"{a:{b:{c:1}}} ->",-1),s=t(`<p>Args:</p><pre><code>config: 配置项目
</code></pre><p>Returns:</p><pre><code>
</code></pre><h3 id="def-load-from-yaml-file-str-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-from-yaml-file-str-dict-str-any"><span><em><strong>def</strong></em> <code>load_from_yaml(file: str) -&gt; dict[str, Any]</code></span></a></h3><p>Load config from yaml file</p><h3 id="def-load-from-json-file-str-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-from-json-file-str-dict-str-any"><span><em><strong>def</strong></em> <code>load_from_json(file: str) -&gt; dict[str, Any]</code></span></a></h3><p>Load config from json file</p><h3 id="def-load-from-toml-file-str-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-from-toml-file-str-dict-str-any"><span><em><strong>def</strong></em> <code>load_from_toml(file: str) -&gt; dict[str, Any]</code></span></a></h3><p>Load config from toml file</p><h3 id="def-load-from-files-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-from-files-dict-str-any"><span><em><strong>def</strong></em> <code>load_from_files() -&gt; dict[str, Any]</code></span></a></h3><p></p><p></p><h3 id="def-load-configs-from-dirs-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-configs-from-dirs-dict-str-any"><span><em><strong>def</strong></em> <code>load_configs_from_dirs() -&gt; dict[str, Any]</code></span></a></h3><p></p><p></p><p></p><h3 id="def-load-config-in-default-no-waring-bool-dict-str-any" tabindex="-1"><a class="header-anchor" href="#def-load-config-in-default-no-waring-bool-dict-str-any"><span><em><strong>def</strong></em> <code>load_config_in_default(no_waring: bool) -&gt; dict[str, Any]</code></span></a></h3><p></p><p>config.*config</p><p></p><h3 id="class-satorinodeconfig-basemodel" tabindex="-1"><a class="header-anchor" href="#class-satorinodeconfig-basemodel"><span><em><strong>class</strong></em> <code>SatoriNodeConfig(BaseModel)</code></span></a></h3><h3 id="class-satoriconfig-basemodel" tabindex="-1"><a class="header-anchor" href="#class-satoriconfig-basemodel"><span><em><strong>class</strong></em> <code>SatoriConfig(BaseModel)</code></span></a></h3><h3 id="class-basicconfig-basemodel" tabindex="-1"><a class="header-anchor" href="#class-basicconfig-basemodel"><span><em><strong>class</strong></em> <code>BasicConfig(BaseModel)</code></span></a></h3><h3 id="var-new-config-copy-deepcopy-config" tabindex="-1"><a class="header-anchor" href="#var-new-config-copy-deepcopy-config"><span><em><strong>var</strong></em> <code>new_config = copy.deepcopy(config)</code></span></a></h3><h3 id="var-config-yaml-safe-load-open-file-r-encoding-utf-8" tabindex="-1"><a class="header-anchor" href="#var-config-yaml-safe-load-open-file-r-encoding-utf-8"><span><em><strong>var</strong></em> <code>config = yaml.safe_load(open(file, &#39;r&#39;, encoding=&#39;utf-8&#39;))</code></span></a></h3><h3 id="var-config-json-load-open-file-r-encoding-utf-8" tabindex="-1"><a class="header-anchor" href="#var-config-json-load-open-file-r-encoding-utf-8"><span><em><strong>var</strong></em> <code>config = json.load(open(file, &#39;r&#39;, encoding=&#39;utf-8&#39;))</code></span></a></h3><h3 id="var-config-toml-load-open-file-r-encoding-utf-8" tabindex="-1"><a class="header-anchor" href="#var-config-toml-load-open-file-r-encoding-utf-8"><span><em><strong>var</strong></em> <code>config = toml.load(open(file, &#39;r&#39;, encoding=&#39;utf-8&#39;))</code></span></a></h3><h3 id="var-config" tabindex="-1"><a class="header-anchor" href="#var-config"><span><em><strong>var</strong></em> <code>config = {}</code></span></a></h3><h3 id="var-config-1" tabindex="-1"><a class="header-anchor" href="#var-config-1"><span><em><strong>var</strong></em> <code>config = {}</code></span></a></h3><h3 id="var-config-load-configs-from-d