mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Docs update
This commit is contained in:
parent
8e96cc0a07
commit
e9d8a16ef2
37 changed files with 180 additions and 65 deletions
5
docs/README.md
Normal file
5
docs/README.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# `docs`
|
||||
|
||||
Leave the `index.html` and the `.nojekyll` files here, otherwise GitHub pages will break.
|
||||
|
||||
To update the docs, **delete all folders inside this one** and run `make html` in the `docs_source` folder.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -14,9 +14,8 @@ royalnet
|
|||
web
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
Some useful links
|
||||
------------------------------------
|
||||
|
||||
* `Royalnet on GitHub <https://github.com/royal-games/royalnet>`_
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
|
@ -10,3 +10,11 @@ royalnet.web
|
|||
:private-members:
|
||||
:undoc-members:
|
||||
|
||||
|
||||
Royalprints
|
||||
------------------------------------
|
||||
|
||||
.. automodule:: royalnet.web.royalprints
|
||||
:members:
|
||||
:private-members:
|
||||
:undoc-members:
|
||||
|
|
|
@ -535,7 +535,7 @@ The name of the downloaded and PCM-converted audio file.</p>
|
|||
<dl class="class">
|
||||
<dt id="royalnet.audio.RoyalPCMAudio">
|
||||
<em class="property">class </em><code class="descclassname">royalnet.audio.</code><code class="descname">RoyalPCMAudio</code><span class="sig-paren">(</span><em>rpf: royalnet.audio.royalpcmfile.RoyalPCMFile</em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.audio.RoyalPCMAudio" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A <a class="reference external" href="https://discordpy.readthedocs.io/en/latest/api.html#discord.AudioSource" title="(in discord.py v1.2.0a)"><code class="xref py py-class docutils literal notranslate"><span class="pre">discord.AudioSource</span></code></a> that keeps data in a file instead of in memory.</p>
|
||||
<dd><p>A <a class="reference external" href="https://discordpy.readthedocs.io/en/latest/api.html#discord.AudioSource" title="(in discord.py v1.2.2)"><code class="xref py py-class docutils literal notranslate"><span class="pre">discord.AudioSource</span></code></a> that keeps data in a file instead of in memory.</p>
|
||||
<dl class="method">
|
||||
<dt id="royalnet.audio.RoyalPCMAudio.__init__">
|
||||
<code class="descname">__init__</code><span class="sig-paren">(</span><em>rpf: royalnet.audio.royalpcmfile.RoyalPCMFile</em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.audio.RoyalPCMAudio.__init__" title="Permalink to this definition">¶</a></dt>
|
||||
|
|
|
@ -218,7 +218,7 @@
|
|||
<dl class="method">
|
||||
<dt id="royalnet.bots.DiscordBot._bot_factory">
|
||||
<code class="descname">_bot_factory</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Type[discord.client.Client]<a class="headerlink" href="#royalnet.bots.DiscordBot._bot_factory" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Create a custom DiscordClient class inheriting from <a class="reference external" href="https://discordpy.readthedocs.io/en/latest/api.html#discord.Client" title="(in discord.py v1.2.0a)"><code class="xref py py-class docutils literal notranslate"><span class="pre">discord.Client</span></code></a>.</p>
|
||||
<dd><p>Create a custom DiscordClient class inheriting from <a class="reference external" href="https://discordpy.readthedocs.io/en/latest/api.html#discord.Client" title="(in discord.py v1.2.2)"><code class="xref py py-class docutils literal notranslate"><span class="pre">discord.Client</span></code></a>.</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="method">
|
||||
|
@ -284,7 +284,7 @@
|
|||
|
||||
<dl class="class">
|
||||
<dt id="royalnet.bots.GenericBot">
|
||||
<em class="property">class </em><code class="descclassname">royalnet.bots.</code><code class="descname">GenericBot</code><span class="sig-paren">(</span><em>*</em>, <em>royalnet_config: Optional[royalnet.network.royalnetconfig.RoyalnetConfig] = None</em>, <em>database_config: Optional[royalnet.database.databaseconfig.DatabaseConfig] = None</em>, <em>command_prefix: str</em>, <em>commands: List[Type[royalnet.utils.command.Command]] = None</em>, <em>missing_command: Type[royalnet.utils.command.Command] = <class 'royalnet.commands.null.NullCommand'></em>, <em>error_command: Type[royalnet.utils.command.Command] = <class 'royalnet.commands.null.NullCommand'></em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.bots.GenericBot" title="Permalink to this definition">¶</a></dt>
|
||||
<em class="property">class </em><code class="descclassname">royalnet.bots.</code><code class="descname">GenericBot</code><span class="sig-paren">(</span><em>*</em>, <em>royalnet_config: Optional[royalnet.network.royalnetconfig.RoyalnetConfig] = None</em>, <em>database_config: Optional[royalnet.database.databaseconfig.DatabaseConfig] = None</em>, <em>command_prefix: str</em>, <em>commands: List[Type[royalnet.utils.command.Command]] = None</em>, <em>missing_command: Type[royalnet.utils.command.Command] = <class 'royalnet.commands.null.NullCommand'></em>, <em>error_command: Type[royalnet.utils.command.Command] = <class 'royalnet.commands.null.NullCommand'></em>, <em>loop: asyncio.events.AbstractEventLoop = None</em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.bots.GenericBot" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A generic bot class, to be used as base for the other more specific classes, such as <span class="xref std std-ref">royalnet.bots.TelegramBot</span> and <span class="xref std std-ref">royalnet.bots.DiscordBot</span>.</p>
|
||||
<dl class="method">
|
||||
<dt id="royalnet.bots.GenericBot._call_factory">
|
||||
|
|
|
@ -262,7 +262,7 @@
|
|||
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.database.tables.Telegram.royal">
|
||||
<code class="descname">royal</code><em class="property"> = <RelationshipProperty at 0x72f7a98; no key></em><a class="headerlink" href="#royalnet.database.tables.Telegram.royal" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descname">royal</code><em class="property"> = <RelationshipProperty at 0x7f4e4f8; no key></em><a class="headerlink" href="#royalnet.database.tables.Telegram.royal" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
|
@ -292,7 +292,7 @@
|
|||
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.database.tables.Diario.creator">
|
||||
<code class="descname">creator</code><em class="property"> = <RelationshipProperty at 0x72f7c48; no key></em><a class="headerlink" href="#royalnet.database.tables.Diario.creator" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descname">creator</code><em class="property"> = <RelationshipProperty at 0x7f4e108; no key></em><a class="headerlink" href="#royalnet.database.tables.Diario.creator" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
|
@ -317,7 +317,7 @@
|
|||
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.database.tables.Diario.quoted_account">
|
||||
<code class="descname">quoted_account</code><em class="property"> = <RelationshipProperty at 0x72f7f60; no key></em><a class="headerlink" href="#royalnet.database.tables.Diario.quoted_account" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descname">quoted_account</code><em class="property"> = <RelationshipProperty at 0x7f4ea08; no key></em><a class="headerlink" href="#royalnet.database.tables.Diario.quoted_account" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
|
@ -352,7 +352,7 @@
|
|||
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.database.tables.Alias.royal">
|
||||
<code class="descname">royal</code><em class="property"> = <RelationshipProperty at 0x72f74b0; no key></em><a class="headerlink" href="#royalnet.database.tables.Alias.royal" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descname">royal</code><em class="property"> = <RelationshipProperty at 0x7f4e6a8; no key></em><a class="headerlink" href="#royalnet.database.tables.Alias.royal" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
|
@ -367,7 +367,7 @@
|
|||
<em class="property">class </em><code class="descclassname">royalnet.database.tables.</code><code class="descname">ActiveKvGroup</code><a class="headerlink" href="#royalnet.database.tables.ActiveKvGroup" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><dl class="attribute">
|
||||
<dt id="royalnet.database.tables.ActiveKvGroup.group">
|
||||
<code class="descname">group</code><em class="property"> = <RelationshipProperty at 0x72f7978; no key></em><a class="headerlink" href="#royalnet.database.tables.ActiveKvGroup.group" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descname">group</code><em class="property"> = <RelationshipProperty at 0x7f4e420; no key></em><a class="headerlink" href="#royalnet.database.tables.ActiveKvGroup.group" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
|
@ -377,7 +377,7 @@
|
|||
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.database.tables.ActiveKvGroup.royal">
|
||||
<code class="descname">royal</code><em class="property"> = <RelationshipProperty at 0x72f7ae0; no key></em><a class="headerlink" href="#royalnet.database.tables.ActiveKvGroup.royal" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descname">royal</code><em class="property"> = <RelationshipProperty at 0x7f4e2b8; no key></em><a class="headerlink" href="#royalnet.database.tables.ActiveKvGroup.royal" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
|
@ -392,7 +392,7 @@
|
|||
<em class="property">class </em><code class="descclassname">royalnet.database.tables.</code><code class="descname">Keyvalue</code><a class="headerlink" href="#royalnet.database.tables.Keyvalue" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><dl class="attribute">
|
||||
<dt id="royalnet.database.tables.Keyvalue.group">
|
||||
<code class="descname">group</code><em class="property"> = <RelationshipProperty at 0x72f7c90; no key></em><a class="headerlink" href="#royalnet.database.tables.Keyvalue.group" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descname">group</code><em class="property"> = <RelationshipProperty at 0x7f4e930; no key></em><a class="headerlink" href="#royalnet.database.tables.Keyvalue.group" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
|
@ -447,7 +447,7 @@
|
|||
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.database.tables.Discord.royal">
|
||||
<code class="descname">royal</code><em class="property"> = <RelationshipProperty at 0x72f7930; no key></em><a class="headerlink" href="#royalnet.database.tables.Discord.royal" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descname">royal</code><em class="property"> = <RelationshipProperty at 0x7f4ea50; no key></em><a class="headerlink" href="#royalnet.database.tables.Discord.royal" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
|
@ -475,6 +475,16 @@
|
|||
<code class="descname">content</code><em class="property"> = Column(None, Text(), table=None)</em><a class="headerlink" href="#royalnet.database.tables.WikiPage.content" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.database.tables.WikiPage.css">
|
||||
<code class="descname">css</code><em class="property"> = Column(None, String(), table=None)</em><a class="headerlink" href="#royalnet.database.tables.WikiPage.css" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.database.tables.WikiPage.format">
|
||||
<code class="descname">format</code><em class="property"> = Column(None, String(), table=None, nullable=False, default=ColumnDefault('markdown'))</em><a class="headerlink" href="#royalnet.database.tables.WikiPage.format" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.database.tables.WikiPage.page_id">
|
||||
<code class="descname">page_id</code><em class="property"> = Column(None, UUID(as_uuid=True), table=None, primary_key=True, nullable=False)</em><a class="headerlink" href="#royalnet.database.tables.WikiPage.page_id" title="Permalink to this definition">¶</a></dt>
|
||||
|
@ -497,7 +507,7 @@
|
|||
</div>
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.database.tables.WikiRevision.author">
|
||||
<code class="descname">author</code><em class="property"> = <RelationshipProperty at 0x730d228; no key></em><a class="headerlink" href="#royalnet.database.tables.WikiRevision.author" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descname">author</code><em class="property"> = <RelationshipProperty at 0x7f4e3d8; no key></em><a class="headerlink" href="#royalnet.database.tables.WikiRevision.author" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
|
@ -512,7 +522,7 @@
|
|||
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.database.tables.WikiRevision.page">
|
||||
<code class="descname">page</code><em class="property"> = <RelationshipProperty at 0x730d588; no key></em><a class="headerlink" href="#royalnet.database.tables.WikiRevision.page" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descname">page</code><em class="property"> = <RelationshipProperty at 0x7f46f60; no key></em><a class="headerlink" href="#royalnet.database.tables.WikiRevision.page" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="attribute">
|
||||
|
|
|
@ -331,10 +331,10 @@
|
|||
</li>
|
||||
<li><a href="network.html#royalnet.network.RoyalnetLink.connect">connect() (royalnet.network.RoyalnetLink method)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="network.html#royalnet.network.ConnectionClosedError">ConnectionClosedError</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="database.html#royalnet.database.tables.WikiPage.content">content (royalnet.database.tables.WikiPage attribute)</a>
|
||||
</li>
|
||||
<li><a href="database.html#royalnet.database.tables.Diario.context">context (royalnet.database.tables.Diario attribute)</a>
|
||||
|
@ -360,6 +360,8 @@
|
|||
<li><a href="database.html#royalnet.database.tables.Diario.creator">creator (royalnet.database.tables.Diario attribute)</a>
|
||||
</li>
|
||||
<li><a href="database.html#royalnet.database.tables.Diario.creator_id">creator_id (royalnet.database.tables.Diario attribute)</a>
|
||||
</li>
|
||||
<li><a href="database.html#royalnet.database.tables.WikiPage.css">css (royalnet.database.tables.WikiPage attribute)</a>
|
||||
</li>
|
||||
<li><a href="commands.html#royalnet.commands.CvCommand">CvCommand (class in royalnet.commands)</a>
|
||||
</li>
|
||||
|
@ -398,6 +400,8 @@
|
|||
<li><a href="database.html#royalnet.database.tables.WikiRevision.diff">diff (royalnet.database.tables.WikiRevision attribute)</a>
|
||||
</li>
|
||||
<li><a href="database.html#royalnet.database.tables.Discord">Discord (class in royalnet.database.tables)</a>
|
||||
</li>
|
||||
<li><a href="utils.html#royalnet.utils.discord_escape">discord_escape() (in module royalnet.utils)</a>
|
||||
</li>
|
||||
<li><a href="database.html#royalnet.database.tables.Discord.discord_id">discord_id (royalnet.database.tables.Discord attribute)</a>
|
||||
</li>
|
||||
|
@ -432,6 +436,8 @@
|
|||
<li><a href="network.html#royalnet.network.RoyalnetServer.find_destination">find_destination() (royalnet.network.RoyalnetServer method)</a>
|
||||
</li>
|
||||
<li><a href="database.html#royalnet.database.tables.Telegram.first_name">first_name (royalnet.database.tables.Telegram attribute)</a>
|
||||
</li>
|
||||
<li><a href="database.html#royalnet.database.tables.WikiPage.format">format (royalnet.database.tables.WikiPage attribute)</a>
|
||||
</li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
|
@ -723,8 +729,6 @@
|
|||
<li><a href="database.html#royalnet.database.tables.Telegram.royal">(royalnet.database.tables.Telegram attribute)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="database.html#royalnet.database.tables.ActiveKvGroup.royal_id">royal_id (royalnet.database.tables.ActiveKvGroup attribute)</a>
|
||||
|
||||
<ul>
|
||||
|
@ -735,6 +739,8 @@
|
|||
<li><a href="database.html#royalnet.database.tables.Telegram.royal_id">(royalnet.database.tables.Telegram attribute)</a>
|
||||
</li>
|
||||
</ul></li>
|
||||
</ul></td>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="audio.html#module-royalnet.audio">royalnet.audio (module)</a>
|
||||
</li>
|
||||
<li><a href="bots.html#module-royalnet.bots">royalnet.bots (module)</a>
|
||||
|
@ -752,6 +758,8 @@
|
|||
<li><a href="utils.html#module-royalnet.utils">royalnet.utils (module)</a>
|
||||
</li>
|
||||
<li><a href="web.html#module-royalnet.web">royalnet.web (module)</a>
|
||||
</li>
|
||||
<li><a href="web.html#module-royalnet.web.royalprints">royalnet.web.royalprints (module)</a>
|
||||
</li>
|
||||
<li><a href="network.html#royalnet.network.RoyalnetConfig">RoyalnetConfig (class in royalnet.network)</a>
|
||||
</li>
|
||||
|
@ -824,6 +832,8 @@
|
|||
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||
<td style="width: 33%; vertical-align: top;"><ul>
|
||||
<li><a href="database.html#royalnet.database.tables.Telegram">Telegram (class in royalnet.database.tables)</a>
|
||||
</li>
|
||||
<li><a href="utils.html#royalnet.utils.telegram_escape">telegram_escape() (in module royalnet.utils)</a>
|
||||
</li>
|
||||
<li><a href="bots.html#royalnet.bots.TelegramBot">TelegramBot (class in royalnet.bots)</a>
|
||||
</li>
|
||||
|
|
|
@ -178,19 +178,19 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="error.html">royalnet.error</a><ul class="simple">
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="web.html">royalnet.web</a><ul class="simple">
|
||||
<li class="toctree-l1"><a class="reference internal" href="web.html">royalnet.web</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="web.html#module-royalnet.web.royalprints">Royalprints</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="indices-and-tables">
|
||||
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="some-useful-links">
|
||||
<h2>Some useful links<a class="headerlink" href="#some-useful-links" title="Permalink to this headline">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p><a class="reference external" href="https://github.com/royal-games/royalnet">Royalnet on GitHub</a></p></li>
|
||||
<li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
|
||||
<li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li>
|
||||
<li><p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@
|
|||
<span class="target" id="module-royalnet.network"></span><p>Royalnet (websocket) related classes.</p>
|
||||
<dl class="class">
|
||||
<dt id="royalnet.network.RoyalnetLink">
|
||||
<em class="property">class </em><code class="descclassname">royalnet.network.</code><code class="descname">RoyalnetLink</code><span class="sig-paren">(</span><em>master_uri: str</em>, <em>secret: str</em>, <em>link_type: str</em>, <em>request_handler</em>, <em>*</em>, <em>loop: asyncio.events.AbstractEventLoop = <_WindowsSelectorEventLoop running=False closed=False debug=False></em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.network.RoyalnetLink" title="Permalink to this definition">¶</a></dt>
|
||||
<em class="property">class </em><code class="descclassname">royalnet.network.</code><code class="descname">RoyalnetLink</code><span class="sig-paren">(</span><em>master_uri: str</em>, <em>secret: str</em>, <em>link_type: str</em>, <em>request_handler</em>, <em>*</em>, <em>loop: asyncio.events.AbstractEventLoop = None</em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.network.RoyalnetLink" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><dl class="method">
|
||||
<dt id="royalnet.network.RoyalnetLink.connect">
|
||||
<code class="descname">connect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.network.RoyalnetLink.connect" title="Permalink to this definition">¶</a></dt>
|
||||
|
@ -296,7 +296,7 @@ Contains info about the source and the destination.</p>
|
|||
|
||||
<dl class="class">
|
||||
<dt id="royalnet.network.RoyalnetServer">
|
||||
<em class="property">class </em><code class="descclassname">royalnet.network.</code><code class="descname">RoyalnetServer</code><span class="sig-paren">(</span><em>address: str</em>, <em>port: int</em>, <em>required_secret: str</em>, <em>*</em>, <em>loop: asyncio.events.AbstractEventLoop = <_WindowsSelectorEventLoop running=False closed=False debug=False></em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.network.RoyalnetServer" title="Permalink to this definition">¶</a></dt>
|
||||
<em class="property">class </em><code class="descclassname">royalnet.network.</code><code class="descname">RoyalnetServer</code><span class="sig-paren">(</span><em>address: str</em>, <em>port: int</em>, <em>required_secret: str</em>, <em>*</em>, <em>loop: asyncio.events.AbstractEventLoop = None</em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.network.RoyalnetServer" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><dl class="method">
|
||||
<dt id="royalnet.network.RoyalnetServer.find_client">
|
||||
<code class="descname">find_client</code><span class="sig-paren">(</span><em>*</em>, <em>nid: str = None</em>, <em>link_type: str = None</em><span class="sig-paren">)</span> → List[royalnet.network.royalnetserver.ConnectedClient]<a class="headerlink" href="#royalnet.network.RoyalnetServer.find_client" title="Permalink to this definition">¶</a></dt>
|
||||
|
|
Binary file not shown.
|
@ -212,6 +212,11 @@
|
|||
<td>   
|
||||
<a href="web.html#module-royalnet.web"><code class="xref">royalnet.web</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="web.html#module-royalnet.web.royalprints"><code class="xref">royalnet.web.royalprints</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -172,7 +172,7 @@
|
|||
|
||||
<dl class="class">
|
||||
<dt id="royalnet.utils.Call">
|
||||
<em class="property">class </em><code class="descclassname">royalnet.utils.</code><code class="descname">Call</code><span class="sig-paren">(</span><em>channel, command: Type[royalnet.utils.command.Command], command_args: List[str] = None, **kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.utils.Call" title="Permalink to this definition">¶</a></dt>
|
||||
<em class="property">class </em><code class="descclassname">royalnet.utils.</code><code class="descname">Call</code><span class="sig-paren">(</span><em>channel, command: Type[royalnet.utils.command.Command], command_args: List[str] = None, loop: asyncio.events.AbstractEventLoop = None, **kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.utils.Call" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A command call. An abstract class, sub-bots should create a new call class from this.</p>
|
||||
<dl class="attribute">
|
||||
<dt id="royalnet.utils.Call.interface_name">
|
||||
|
@ -200,7 +200,7 @@
|
|||
|
||||
<dl class="method">
|
||||
<dt id="royalnet.utils.Call.__init__">
|
||||
<code class="descname">__init__</code><span class="sig-paren">(</span><em>channel, command: Type[royalnet.utils.command.Command], command_args: List[str] = None, **kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.utils.Call.__init__" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="descname">__init__</code><span class="sig-paren">(</span><em>channel, command: Type[royalnet.utils.command.Command], command_args: List[str] = None, loop: asyncio.events.AbstractEventLoop = None, **kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.utils.Call.__init__" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Create the call.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
|
@ -571,6 +571,26 @@ That probably means, the database row identifying the user.</p>
|
|||
<code class="descclassname">royalnet.utils.</code><code class="descname">numberemojiformat</code><span class="sig-paren">(</span><em>l: List[str]</em><span class="sig-paren">)</span> → str<a class="headerlink" href="#royalnet.utils.numberemojiformat" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="royalnet.utils.telegram_escape">
|
||||
<code class="descclassname">royalnet.utils.</code><code class="descname">telegram_escape</code><span class="sig-paren">(</span><em>string: str</em><span class="sig-paren">)</span> → str<a class="headerlink" href="#royalnet.utils.telegram_escape" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Escape a string to be sent through Telegram, and format it using RoyalCode.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Warning</p>
|
||||
<p>Currently escapes everything, even items in code blocks.</p>
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="royalnet.utils.discord_escape">
|
||||
<code class="descclassname">royalnet.utils.</code><code class="descname">discord_escape</code><span class="sig-paren">(</span><em>string: str</em><span class="sig-paren">)</span> → str<a class="headerlink" href="#royalnet.utils.discord_escape" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Escape a string to be sent through Discord, and format it using RoyalCode.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Warning</p>
|
||||
<p>Currently escapes everything, even items in code blocks.</p>
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -87,7 +87,8 @@
|
|||
<li class="toctree-l1"><a class="reference internal" href="network.html">royalnet.network</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="utils.html">royalnet.utils</a></li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="error.html">royalnet.error</a></li>
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">royalnet.web</a><ul class="simple">
|
||||
<li class="toctree-l1 current"><a class="current reference internal" href="#">royalnet.web</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#module-royalnet.web.royalprints">Royalprints</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -161,13 +162,37 @@
|
|||
<span class="target" id="module-royalnet.web"></span><dl class="function">
|
||||
<dt id="royalnet.web.create_app">
|
||||
<code class="descclassname">royalnet.web.</code><code class="descname">create_app</code><span class="sig-paren">(</span><em>config_obj: Type[CT_co], blueprints: List[royalnet.web.royalprint.Royalprint]</em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.web.create_app" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
<dd><p>Create a <code class="xref py py-class docutils literal notranslate"><span class="pre">flask.Flask</span></code> application object.</p>
|
||||
<p>Gets the <code class="docutils literal notranslate"><span class="pre">app.secret_key</span></code> from the <code class="docutils literal notranslate"><span class="pre">SECRET_KEY</span></code> envvar.</p>
|
||||
<p>Also requires a <code class="docutils literal notranslate"><span class="pre">DB_PATH</span></code> key in <code class="docutils literal notranslate"><span class="pre">config_obj</span></code> to initialize the database connection.</p>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">Warning</p>
|
||||
<p>The code for this class was written at 1 AM, and I have no clue of how and why it works or even of if it really does work.
|
||||
Use with caution?</p>
|
||||
</div>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>config_obj</strong> – The object to be passed to <code class="xref py py-meth docutils literal notranslate"><span class="pre">flask.Flask.config.from_object()</span></code>.</p></li>
|
||||
<li><p><strong>blueprints</strong> – A list of blueprints to be registered to the application.</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p>The created <code class="xref py py-class docutils literal notranslate"><span class="pre">flask.Flask</span></code>.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="royalnet.web.Royalprint">
|
||||
<em class="property">class </em><code class="descclassname">royalnet.web.</code><code class="descname">Royalprint</code><span class="sig-paren">(</span><em>name</em>, <em>import_name</em>, <em>static_folder=None</em>, <em>static_url_path=None</em>, <em>template_folder=None</em>, <em>url_prefix=None</em>, <em>subdomain=None</em>, <em>url_defaults=None</em>, <em>root_path=None</em>, <em>required_tables: Optional[set] = None</em><span class="sig-paren">)</span><a class="headerlink" href="#royalnet.web.Royalprint" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
<dd><p>An edited <code class="xref py py-class docutils literal notranslate"><span class="pre">flask.Blueprint</span></code> containing an additional <code class="docutils literal notranslate"><span class="pre">required_tables</span></code> parameter.</p>
|
||||
</dd></dl>
|
||||
|
||||
<div class="section" id="module-royalnet.web.royalprints">
|
||||
<span id="royalprints"></span><h2>Royalprints<a class="headerlink" href="#module-royalnet.web.royalprints" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Some Royalprints that can be used with the Royalnet Flask server.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -14,9 +14,8 @@ royalnet
|
|||
web
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
Some useful links
|
||||
------------------------------------
|
||||
|
||||
* `Royalnet on GitHub <https://github.com/royal-games/royalnet>`_
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
|
@ -10,3 +10,11 @@ royalnet.web
|
|||
:private-members:
|
||||
:undoc-members:
|
||||
|
||||
|
||||
Royalprints
|
||||
------------------------------------
|
||||
|
||||
.. automodule:: royalnet.web.royalprints
|
||||
:members:
|
||||
:private-members:
|
||||
:undoc-members:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import os
|
||||
from .web import create_app
|
||||
from .web.blueprints import home, wikiview, tglogin
|
||||
from .web.royalprints import rp_home, rp_wikiview, rp_tglogin
|
||||
|
||||
|
||||
class TestConfig:
|
||||
|
@ -8,7 +8,7 @@ class TestConfig:
|
|||
TG_AK = os.environ["TG_AK"]
|
||||
|
||||
|
||||
app = create_app(TestConfig, [home, wikiview, tglogin])
|
||||
app = create_app(TestConfig, [rp_home, rp_wikiview, rp_tglogin])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from .flaskserver import create_app
|
||||
from .royalprint import Royalprint
|
||||
from . import blueprints
|
||||
|
||||
__all__ = ["create_app", "Royalprint", "blueprints"]
|
||||
__all__ = ["create_app", "Royalprint"]
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
from .home import bp as home
|
||||
from .wikiview import bp as wikiview
|
||||
from .tglogin import bp as tglogin
|
||||
|
||||
__all__ = ["home", "wikiview", "tglogin"]
|
|
@ -7,16 +7,26 @@ from .royalprint import Royalprint
|
|||
|
||||
|
||||
def create_app(config_obj: typing.Type, blueprints: typing.List[Royalprint]):
|
||||
"""Create a :py:class:`flask.Flask` application object.
|
||||
|
||||
Gets the ``app.secret_key`` from the ``SECRET_KEY`` envvar.
|
||||
|
||||
Also requires a ``DB_PATH`` key in ``config_obj`` to initialize the database connection.
|
||||
|
||||
Warning:
|
||||
The code for this class was written at 1 AM, and I have no clue of how and why it works or even of if it really does work.
|
||||
Use with caution?
|
||||
|
||||
Args:
|
||||
config_obj: The object to be passed to :py:meth:`flask.Flask.config.from_object`.
|
||||
blueprints: A list of blueprints to be registered to the application.
|
||||
|
||||
Returns:
|
||||
The created :py:class:`flask.Flask`."""
|
||||
app = f.Flask(__name__)
|
||||
app.config.from_object(config_obj)
|
||||
app.secret_key = os.environ["SECRET_KEY"]
|
||||
|
||||
@app.teardown_request
|
||||
def teardown_alchemy_session(*_, **__):
|
||||
alchemy_session = app.config["ALCHEMY_SESSION"]
|
||||
if alchemy_session is not None:
|
||||
alchemy_session.remove()
|
||||
|
||||
# Load blueprints
|
||||
required_tables = set()
|
||||
for blueprint in blueprints:
|
||||
|
@ -25,6 +35,7 @@ def create_app(config_obj: typing.Type, blueprints: typing.List[Royalprint]):
|
|||
|
||||
# Init Alchemy
|
||||
# Seems like a dirty hack to me, but experiments are fun, right?
|
||||
# WARNING BLACK SORCERY BELOW EDIT AT YOUR OWN RISK
|
||||
if len(required_tables) > 0:
|
||||
alchemy = Alchemy(app.config["DB_PATH"], required_tables)
|
||||
app.config["ALCHEMY"] = alchemy
|
||||
|
@ -32,4 +43,12 @@ def create_app(config_obj: typing.Type, blueprints: typing.List[Royalprint]):
|
|||
else:
|
||||
app.config["ALCHEMY"] = None
|
||||
app.config["ALCHEMY_SESSION"] = None
|
||||
|
||||
@app.teardown_request
|
||||
def teardown_alchemy_session(*_, **__):
|
||||
alchemy_session = app.config["ALCHEMY_SESSION"]
|
||||
if alchemy_session is not None:
|
||||
alchemy_session.remove()
|
||||
# END OF BLACK SORCERY
|
||||
|
||||
return app
|
||||
|
|
|
@ -3,6 +3,8 @@ import flask as f
|
|||
|
||||
|
||||
class Royalprint(f.Blueprint):
|
||||
"""An edited :py:class:`flask.Blueprint` containing an additional ``required_tables`` parameter."""
|
||||
|
||||
def __init__(self, name, import_name, static_folder=None,
|
||||
static_url_path=None, template_folder=None,
|
||||
url_prefix=None, subdomain=None, url_defaults=None,
|
||||
|
|
7
royalnet/web/royalprints/__init__.py
Normal file
7
royalnet/web/royalprints/__init__.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
"""Some Royalprints that can be used with the Royalnet Flask server."""
|
||||
|
||||
from .home import rp as rp_home
|
||||
from .wikiview import rp as rp_wikiview
|
||||
from .tglogin import rp as rp_tglogin
|
||||
|
||||
__all__ = ["rp_home", "rp_wikiview", "rp_tglogin"]
|
|
@ -1,12 +1,13 @@
|
|||
"""Homepage :py:class:`royalnet.web.Royalprint` of the Royal Games website."""
|
||||
import flask as f
|
||||
import os
|
||||
from ... import Royalprint
|
||||
|
||||
|
||||
tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates')
|
||||
bp = Royalprint("home", __name__, template_folder="templates")
|
||||
rp = Royalprint("home", __name__, template_folder="templates")
|
||||
|
||||
|
||||
@bp.route("/")
|
||||
@rp.route("/")
|
||||
def home_index():
|
||||
return f.render_template("home.html")
|
|
@ -1,3 +1,4 @@
|
|||
"""A Royalnet Telegram login :py:class:`royalnet.web.Royalprint`."""
|
||||
import flask as f
|
||||
import hashlib
|
||||
import hmac
|
||||
|
@ -6,17 +7,17 @@ from ... import Royalprint
|
|||
from ....database.tables import Royal, Telegram
|
||||
|
||||
|
||||
bp = Royalprint("tglogin", __name__, url_prefix="/login/telegram", required_tables={Royal, Telegram},
|
||||
rp = Royalprint("tglogin", __name__, url_prefix="/login/telegram", required_tables={Royal, Telegram},
|
||||
template_folder="templates")
|
||||
|
||||
|
||||
@bp.route("/")
|
||||
@rp.route("/")
|
||||
def tglogin_index():
|
||||
f.session.pop("royal", None)
|
||||
return f.render_template("tglogin_index.html")
|
||||
|
||||
|
||||
@bp.route("/done")
|
||||
@rp.route("/done")
|
||||
def tglogin_done():
|
||||
alchemy, alchemy_session = f.current_app.config["ALCHEMY"], f.current_app.config["ALCHEMY_SESSION"]
|
||||
data_check_string = ""
|
|
@ -1,3 +1,5 @@
|
|||
"""A Royal Games Wiki viewer :py:class:`royalnet.web.Royalprint`. Doesn't support any kind of edit."""
|
||||
|
||||
import flask as f
|
||||
import markdown2
|
||||
import re
|
||||
|
@ -8,7 +10,7 @@ from ....database.tables import Royal, WikiPage, WikiRevision
|
|||
|
||||
|
||||
tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates')
|
||||
bp = Royalprint("wikiview", __name__, url_prefix="/wikiview", template_folder=tmpl_dir,
|
||||
rp = Royalprint("wikiview", __name__, url_prefix="/wikiview", template_folder=tmpl_dir,
|
||||
required_tables={Royal, WikiPage, WikiRevision})
|
||||
|
||||
|
||||
|
@ -48,15 +50,15 @@ def prepare_page(page):
|
|||
return "Format not available", 500
|
||||
|
||||
|
||||
@bp.route("/")
|
||||
@rp.route("/")
|
||||
def wikiview_index():
|
||||
alchemy, alchemy_session = f.current_app.config["ALCHEMY"], f.current_app.config["ALCHEMY_SESSION"]
|
||||
pages = sorted(alchemy_session.query(alchemy.WikiPage).all(), key=lambda page: page.title)
|
||||
return f.render_template("wikiview_index.html", pages=pages)
|
||||
|
||||
|
||||
@bp.route("/<uuid:page_id>", defaults={"title": ""})
|
||||
@bp.route("/<uuid:page_id>/<title>")
|
||||
@rp.route("/<uuid:page_id>", defaults={"title": ""})
|
||||
@rp.route("/<uuid:page_id>/<title>")
|
||||
def wikiview_by_id(page_id: uuid.UUID, title: str):
|
||||
alchemy, alchemy_session = f.current_app.config["ALCHEMY"], f.current_app.config["ALCHEMY_SESSION"]
|
||||
page = alchemy_session.query(alchemy.WikiPage).filter(alchemy.WikiPage.page_id == page_id).one_or_none()
|
Loading…
Reference in a new issue