Skip to content

Commit

Permalink
Update doc by Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
aicorein committed Dec 11, 2024
1 parent 3bcfe42 commit 0b53eb4
Show file tree
Hide file tree
Showing 59 changed files with 1,054 additions and 547 deletions.
2 changes: 1 addition & 1 deletion _modules/melobot/_meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
<h1>melobot._meta 源代码</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">annotations</span>

<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">ClassVar</span><span class="p">,</span> <span class="n">Generic</span><span class="p">,</span> <span class="n">Literal</span><span class="p">,</span> <span class="n">NamedTuple</span><span class="p">,</span> <span class="n">NoReturn</span>
<span class="kn">from</span> <span class="nn">typing_extensions</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">ClassVar</span><span class="p">,</span> <span class="n">Generic</span><span class="p">,</span> <span class="n">Literal</span><span class="p">,</span> <span class="n">NamedTuple</span><span class="p">,</span> <span class="n">NoReturn</span>

<span class="kn">from</span> <span class="nn">.typ</span> <span class="kn">import</span> <span class="n">T</span>

Expand Down
20 changes: 12 additions & 8 deletions _modules/melobot/adapter/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -307,20 +307,22 @@ <h1>melobot.adapter.base 源代码</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">contextlib</span> <span class="kn">import</span> <span class="n">AsyncExitStack</span><span class="p">,</span> <span class="n">_GeneratorContextManager</span><span class="p">,</span> <span class="n">asynccontextmanager</span>
<span class="kn">from</span> <span class="nn">enum</span> <span class="kn">import</span> <span class="n">Enum</span>
<span class="kn">from</span> <span class="nn">os</span> <span class="kn">import</span> <span class="n">PathLike</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="p">(</span>

<span class="kn">from</span> <span class="nn">typing_extensions</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">TYPE_CHECKING</span><span class="p">,</span>
<span class="n">AsyncGenerator</span><span class="p">,</span>
<span class="n">Callable</span><span class="p">,</span>
<span class="n">Generic</span><span class="p">,</span>
<span class="n">Iterable</span><span class="p">,</span>
<span class="n">LiteralString</span><span class="p">,</span>
<span class="n">NoReturn</span><span class="p">,</span>
<span class="n">Self</span><span class="p">,</span>
<span class="n">Sequence</span><span class="p">,</span>
<span class="n">TypeVar</span><span class="p">,</span>
<span class="n">cast</span><span class="p">,</span>
<span class="n">final</span><span class="p">,</span>
<span class="p">)</span>

<span class="kn">from</span> <span class="nn">typing_extensions</span> <span class="kn">import</span> <span class="n">LiteralString</span><span class="p">,</span> <span class="n">Self</span><span class="p">,</span> <span class="n">TypeVar</span>

<span class="kn">from</span> <span class="nn">.._hook</span> <span class="kn">import</span> <span class="n">Hookable</span>
<span class="kn">from</span> <span class="nn">..ctx</span> <span class="kn">import</span> <span class="n">EventBuildInfo</span><span class="p">,</span> <span class="n">EventBuildInfoCtx</span><span class="p">,</span> <span class="n">LoggerCtx</span><span class="p">,</span> <span class="n">OutSrcFilterCtx</span>
<span class="kn">from</span> <span class="nn">..exceptions</span> <span class="kn">import</span> <span class="n">AdapterError</span>
Expand Down Expand Up @@ -417,8 +419,8 @@ <h1>melobot.adapter.base 源代码</h1><div class="highlight"><pre>
<span class="k">class</span> <span class="nc">AdapterLifeSpan</span><span class="p">(</span><span class="n">Enum</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;适配器生命周期阶段的枚举&quot;&quot;&quot;</span>

<span class="n">BEFORE_EVENT</span> <span class="o">=</span> <span class="s2">&quot;be&quot;</span>
<span class="n">BEFORE_ACTION</span> <span class="o">=</span> <span class="s2">&quot;ba&quot;</span>
<span class="n">BEFORE_EVENT_HANDLE</span> <span class="o">=</span> <span class="s2">&quot;beh&quot;</span>
<span class="n">BEFORE_ACTION_EXEC</span> <span class="o">=</span> <span class="s2">&quot;bae&quot;</span>
<span class="n">STARTED</span> <span class="o">=</span> <span class="s2">&quot;sta&quot;</span>
<span class="n">STOPPED</span> <span class="o">=</span> <span class="s2">&quot;sto&quot;</span></div>

Expand Down Expand Up @@ -470,7 +472,7 @@ <h1>melobot.adapter.base 源代码</h1><div class="highlight"><pre>
<span class="k">def</span> <span class="nf">on</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">periods</span><span class="p">:</span> <span class="n">AdapterLifeSpan</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="n">Callable</span><span class="p">[[</span><span class="n">AsyncCallable</span><span class="p">[</span><span class="n">P</span><span class="p">,</span> <span class="kc">None</span><span class="p">]],</span> <span class="n">AsyncCallable</span><span class="p">[</span><span class="n">P</span><span class="p">,</span> <span class="kc">None</span><span class="p">]]:</span>
<span class="n">groups</span> <span class="o">=</span> <span class="p">(</span><span class="n">AdapterLifeSpan</span><span class="o">.</span><span class="n">BEFORE_EVENT</span><span class="p">,</span> <span class="n">AdapterLifeSpan</span><span class="o">.</span><span class="n">BEFORE_ACTION</span><span class="p">)</span>
<span class="n">groups</span> <span class="o">=</span> <span class="p">(</span><span class="n">AdapterLifeSpan</span><span class="o">.</span><span class="n">BEFORE_EVENT_HANDLE</span><span class="p">,</span> <span class="n">AdapterLifeSpan</span><span class="o">.</span><span class="n">BEFORE_ACTION_EXEC</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">wrapped</span><span class="p">(</span><span class="n">func</span><span class="p">:</span> <span class="n">AsyncCallable</span><span class="p">[</span><span class="n">P</span><span class="p">,</span> <span class="kc">None</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="n">AsyncCallable</span><span class="p">[</span><span class="n">P</span><span class="p">,</span> <span class="kc">None</span><span class="p">]:</span>
<span class="k">for</span> <span class="nb">type</span> <span class="ow">in</span> <span class="n">periods</span><span class="p">:</span>
Expand Down Expand Up @@ -513,7 +515,7 @@ <h1>melobot.adapter.base 源代码</h1><div class="highlight"><pre>
<span class="n">event</span> <span class="o">=</span> <span class="k">await</span> <span class="bp">self</span><span class="o">.</span><span class="n">_event_factory</span><span class="o">.</span><span class="n">create</span><span class="p">(</span><span class="n">packet</span><span class="p">)</span>
<span class="k">with</span> <span class="n">_EVENT_BUILD_INFO_CTX</span><span class="o">.</span><span class="n">unfold</span><span class="p">(</span><span class="n">EventBuildInfo</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">src</span><span class="p">)):</span>
<span class="k">await</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hook_bus</span><span class="o">.</span><span class="n">emit</span><span class="p">(</span>
<span class="n">AdapterLifeSpan</span><span class="o">.</span><span class="n">BEFORE_EVENT</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">(</span><span class="n">event</span><span class="p">,)</span>
<span class="n">AdapterLifeSpan</span><span class="o">.</span><span class="n">BEFORE_EVENT_HANDLE</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">(</span><span class="n">event</span><span class="p">,)</span>
<span class="p">)</span>
<span class="n">asyncio</span><span class="o">.</span><span class="n">create_task</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">dispatcher</span><span class="o">.</span><span class="n">broadcast</span><span class="p">(</span><span class="n">event</span><span class="p">))</span>
<span class="k">except</span> <span class="ne">Exception</span><span class="p">:</span>
Expand Down Expand Up @@ -593,7 +595,9 @@ <h1>melobot.adapter.base 源代码</h1><div class="highlight"><pre>
<span class="k">else</span><span class="p">:</span>
<span class="n">osrcs</span> <span class="o">=</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">out_srcs</span><span class="p">[</span><span class="mi">0</span><span class="p">],)</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">out_srcs</span><span class="p">)</span> <span class="k">else</span> <span class="p">()</span>

<span class="k">await</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hook_bus</span><span class="o">.</span><span class="n">emit</span><span class="p">(</span><span class="n">AdapterLifeSpan</span><span class="o">.</span><span class="n">BEFORE_ACTION</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">(</span><span class="n">action</span><span class="p">,))</span>
<span class="k">await</span> <span class="bp">self</span><span class="o">.</span><span class="n">_hook_bus</span><span class="o">.</span><span class="n">emit</span><span class="p">(</span>
<span class="n">AdapterLifeSpan</span><span class="o">.</span><span class="n">BEFORE_ACTION_EXEC</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">(</span><span class="n">action</span><span class="p">,)</span>
<span class="p">)</span>
<span class="k">return</span> <span class="nb">tuple</span><span class="p">(</span>
<span class="n">ActionHandle</span><span class="p">(</span><span class="n">action</span><span class="p">,</span> <span class="n">osrc</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_output_factory</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_echo_factory</span><span class="p">)</span>
<span class="k">for</span> <span class="n">osrc</span> <span class="ow">in</span> <span class="n">osrcs</span>
Expand Down
5 changes: 2 additions & 3 deletions _modules/melobot/adapter/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,8 @@ <h1>melobot.adapter.content 源代码</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">annotations</span>

<span class="kn">import</span> <span class="nn">mimetypes</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Hashable</span><span class="p">,</span> <span class="n">Sequence</span>

<span class="kn">from</span> <span class="nn">typing_extensions</span> <span class="kn">import</span> <span class="n">TypeVar</span>
<span class="kn">from</span> <span class="nn">typing_extensions</span> <span class="kn">import</span> <span class="n">Hashable</span><span class="p">,</span> <span class="n">Sequence</span><span class="p">,</span> <span class="n">TypeVar</span>


<div class="viewcode-block" id="Content">
Expand All @@ -315,7 +314,7 @@ <h1>melobot.adapter.content 源代码</h1><div class="highlight"><pre>



<span class="n">ContentT</span> <span class="o">=</span> <span class="n">TypeVar</span><span class="p">(</span><span class="s2">&quot;ContentT&quot;</span><span class="p">,</span> <span class="n">bound</span><span class="o">=</span><span class="n">Content</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="n">Content</span><span class="p">)</span>
<span class="n">ContentT</span> <span class="o">=</span> <span class="n">TypeVar</span><span class="p">(</span><span class="s2">&quot;ContentT&quot;</span><span class="p">,</span> <span class="n">bound</span><span class="o">=</span><span class="n">Content</span><span class="p">)</span>


<div class="viewcode-block" id="TextContent">
Expand Down
3 changes: 2 additions & 1 deletion _modules/melobot/adapter/generic.html
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@
<article role="main" id="furo-main-content">
<h1>melobot.adapter.generic 源代码</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">os</span> <span class="kn">import</span> <span class="n">PathLike</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Sequence</span>

<span class="kn">from</span> <span class="nn">typing_extensions</span> <span class="kn">import</span> <span class="n">Sequence</span>

<span class="kn">from</span> <span class="nn">..ctx</span> <span class="kn">import</span> <span class="n">EventBuildInfoCtx</span>
<span class="kn">from</span> <span class="nn">.content</span> <span class="kn">import</span> <span class="n">Content</span>
Expand Down
Loading

0 comments on commit 0b53eb4

Please sign in to comment.