Skip to content

Commit

Permalink
Remove wikipedia feature integration
Browse files Browse the repository at this point in the history
Fix bug on invalid return type
Release micro version
  • Loading branch information
dormant-user committed May 29, 2024
1 parent b0c70ea commit ec28fe9
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 138 deletions.
7 changes: 0 additions & 7 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,6 @@ Word Match
:members:
:undoc-members:

Wikipedia
=========

.. automodule:: jarvis.executors.wiki
:members:
:undoc-members:

----------Modules----------
===========================
Audio
Expand Down
15 changes: 2 additions & 13 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -1597,13 +1597,6 @@ <h2 id="J">J</h2>

<ul>
<li><a href="index.html#module-jarvis.executors.weather_monitor">module</a>
</li>
</ul></li>
<li>
jarvis.executors.wiki

<ul>
<li><a href="index.html#module-jarvis.executors.wiki">module</a>
</li>
</ul></li>
<li>
Expand Down Expand Up @@ -2282,8 +2275,6 @@ <h2 id="M">M</h2>
<li><a href="index.html#module-jarvis.executors.weather">jarvis.executors.weather</a>
</li>
<li><a href="index.html#module-jarvis.executors.weather_monitor">jarvis.executors.weather_monitor</a>
</li>
<li><a href="index.html#module-jarvis.executors.wiki">jarvis.executors.wiki</a>
</li>
<li><a href="index.html#module-jarvis.executors.word_match">jarvis.executors.word_match</a>
</li>
Expand Down Expand Up @@ -3383,6 +3374,8 @@ <h2 id="W">W</h2>
</li>
<li><a href="index.html#jarvis.executors.static_responses.who">who() (in module jarvis.executors.static_responses)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#jarvis.modules.telegram.settings.PhotoFragment.width">width (jarvis.modules.telegram.settings.PhotoFragment attribute)</a>

<ul>
Expand All @@ -3393,17 +3386,13 @@ <h2 id="W">W</h2>
<li><a href="index.html#jarvis.modules.telegram.settings.Video.Thumbnail.width">(jarvis.modules.telegram.settings.Video.Thumbnail attribute)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="index.html#jarvis.executors.connection.wifi">wifi() (in module jarvis.executors.connection)</a>
</li>
<li><a href="index.html#jarvis.modules.models.classes.EnvConfig.wifi_password">wifi_password (jarvis.modules.models.classes.EnvConfig attribute)</a>
</li>
<li><a href="index.html#jarvis.modules.models.classes.EnvConfig.wifi_ssid">wifi_ssid (jarvis.modules.models.classes.EnvConfig attribute)</a>
</li>
<li><a href="index.html#jarvis.modules.models.classes.WiFiConnection">WiFiConnection (class in jarvis.modules.models.classes)</a>
</li>
<li><a href="index.html#jarvis.executors.wiki.wikipedia_">wikipedia_() (in module jarvis.executors.wiki)</a>
</li>
<li><a href="index.html#jarvis.modules.microphone.graph_mic.Settings.window">window (jarvis.modules.microphone.graph_mic.Settings attribute)</a>
</li>
Expand Down
25 changes: 2 additions & 23 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4670,12 +4670,6 @@ <h1>———-Executors———-<a class="headerlink" href="#executors" title="
<li><p>Uses NTFY topic to send a push notification</p></li>
</ul>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<ul class="simple">
<li><p>Personalized icons for <a class="reference external" href="https://wiki.ubuntu.com/Artwork/BreatheIconSet/Icons">Linux OS</a></p></li>
</ul>
</div>
</dd></dl>

</section>
Expand Down Expand Up @@ -5360,20 +5354,6 @@ <h1>———-Executors———-<a class="headerlink" href="#executors" title="
</dl>
</dd></dl>

</section>
<section id="module-jarvis.executors.wiki">
<span id="wikipedia"></span><h1>Wikipedia<a class="headerlink" href="#module-jarvis.executors.wiki" title="Permalink to this heading">¶</a></h1>
<dl class="py function">
<dt class="sig sig-object py" id="jarvis.executors.wiki.wikipedia_">
<span class="sig-prename descclassname"><span class="pre">jarvis.executors.wiki.</span></span><span class="sig-name descname"><span class="pre">wikipedia_</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">phrase</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="headerlink" href="#jarvis.executors.wiki.wikipedia_" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets any information from wikipedia using its API.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>phrase</strong> – Takes the phrase spoken as an argument.</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="modules">
<h1>———-Modules———-<a class="headerlink" href="#modules" title="Permalink to this heading">¶</a></h1>
Expand Down Expand Up @@ -5735,12 +5715,12 @@ <h1>———-Modules———-<a class="headerlink" href="#modules" title="Perm

<dl class="py function">
<dt class="sig sig-object py" id="jarvis.modules.builtin_overrides.ordered_dump">
<span class="sig-prename descclassname"><span class="pre">jarvis.modules.builtin_overrides.</span></span><span class="sig-name descname"><span class="pre">ordered_dump</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stream=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Dumper=&lt;class</span> <span class="pre">'yaml.dumper.SafeDumper'&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">**kwds</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">None</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">bytes</span></span></span><a class="headerlink" href="#jarvis.modules.builtin_overrides.ordered_dump" title="Permalink to this definition">¶</a></dt>
<span class="sig-prename descclassname"><span class="pre">jarvis.modules.builtin_overrides.</span></span><span class="sig-name descname"><span class="pre">ordered_dump</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dump</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">stream=None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Dumper=&lt;class</span> <span class="pre">'yaml.dumper.SafeDumper'&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">**kwds</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">None</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">bytes</span></span></span><a class="headerlink" href="#jarvis.modules.builtin_overrides.ordered_dump" title="Permalink to this definition">¶</a></dt>
<dd><p>Custom dumper to serialize OrderedDict.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>data</strong> – Data to be dumped into yaml file.</p></li>
<li><p><strong>dump</strong> – Data to be dumped into yaml file.</p></li>
<li><p><strong>stream</strong> – FileIO stream.</p></li>
<li><p><strong>Dumper</strong> – Yaml dumper.</p></li>
<li><p><strong>kwds</strong> – Keyword arguments like indent.</p></li>
Expand Down Expand Up @@ -11083,7 +11063,6 @@ <h3><a href="#">Table of Contents</a></h3>
<li><a class="reference internal" href="#module-jarvis.executors.vpn_server">VPN Server</a></li>
<li><a class="reference internal" href="#module-jarvis.executors.weather">Weather</a></li>
<li><a class="reference internal" href="#module-jarvis.executors.word_match">Word Match</a></li>
<li><a class="reference internal" href="#module-jarvis.executors.wiki">Wikipedia</a></li>
<li><a class="reference internal" href="#modules">———-Modules———-</a></li>
<li><a class="reference internal" href="#module-jarvis.modules.audio.speaker">Audio</a></li>
<li><a class="reference internal" href="#module-jarvis.modules.auth_bearer">Auth Bearer</a></li>
Expand Down
Binary file modified docs/objects.inv
Binary file not shown.
5 changes: 0 additions & 5 deletions docs/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -419,11 +419,6 @@ <h1>Python Module Index</h1>
<td>&#160;&#160;&#160;
<a href="index.html#module-jarvis.executors.weather_monitor"><code class="xref">jarvis.executors.weather_monitor</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="index.html#module-jarvis.executors.wiki"><code class="xref">jarvis.executors.wiki</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions docs_gen/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,6 @@ Word Match
:members:
:undoc-members:

Wikipedia
=========

.. automodule:: jarvis.executors.wiki
:members:
:undoc-members:

----------Modules----------
===========================
Audio
Expand Down
2 changes: 1 addition & 1 deletion jarvis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from multiprocessing import current_process

version = "4.5"
version = "4.5.1"

install_script = os.path.join(os.path.dirname(__file__), "lib", "install.sh")

Expand Down
2 changes: 1 addition & 1 deletion jarvis/_preexec/keywords_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def rewrite_keywords() -> None:
)

with open(models.fileio.keywords, "w") as dst_file:
ordered_dump(stream=dst_file, data=keywords_src, indent=4)
ordered_dump(keywords_src, stream=dst_file, indent=4)
keywords.keywords = keywords_src
load_ignores(keywords_src)

Expand Down
2 changes: 0 additions & 2 deletions jarvis/executors/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
volume,
vpn_server,
weather,
wiki,
)
from jarvis.modules.audio import voices
from jarvis.modules.meetings import events, ics_meetings
Expand Down Expand Up @@ -66,7 +65,6 @@ def function_mapping() -> OrderedDict[str, Callable]:
current_time=date_time.current_time,
system_info=system.system_info,
ip_info=internet.ip_info,
wikipedia_=wiki.wikipedia_,
news=others.news,
report=others.report,
robinhood=robinhood.robinhood,
Expand Down
3 changes: 0 additions & 3 deletions jarvis/executors/remind.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,6 @@ def executor(message: str, contact: str = None) -> None:
- Uses recipient email address to send email notification
- Uses telegram account ID to send a message notification
- Uses NTFY topic to send a push notification
See Also:
- Personalized icons for `Linux OS <https://wiki.ubuntu.com/Artwork/BreatheIconSet/Icons>`__
"""
if classes.ReminderOptions.all in models.env.notify_reminders:
notify_phone, notify_email, notify_telegram, ntfy = True, True, True, True
Expand Down
65 changes: 0 additions & 65 deletions jarvis/executors/wiki.py

This file was deleted.

14 changes: 7 additions & 7 deletions jarvis/modules/builtin_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ def construct_mapping(loader: Loader, node: MappingNode) -> collections.OrderedD

# noinspection PyPep8Naming
def ordered_dump(
data, stream=None, Dumper=yaml.SafeDumper, **kwds # noqa: N803
) -> None | str | bytes: # noqa
dump, stream=None, Dumper=yaml.SafeDumper, **kwds
) -> None | str | bytes:
"""Custom dumper to serialize OrderedDict.
Args:
data: Data to be dumped into yaml file.
dump: Data to be dumped into yaml file.
stream: FileIO stream.
Dumper: Yaml dumper.
kwds: Keyword arguments like indent.
Expand All @@ -89,12 +89,12 @@ class OrderedDumper(Dumper):

pass

def _dict_representer(dumper: Dumper, data: dict) -> Node: # noqa
def _dict_representer(dumper: Dumper, data: dict) -> MappingNode:
"""Overrides built-in representer.
Args:
dumper: yaml dumper.
data: data to be dumped.
dumper: Yaml dumper.
data: Data to be dumped.
Returns:
Node:
Expand All @@ -107,7 +107,7 @@ def _dict_representer(dumper: Dumper, data: dict) -> Node: # noqa
OrderedDumper.add_representer(
data_type=collections.OrderedDict, representer=_dict_representer
)
return yaml.dump(data=data, stream=stream, Dumper=OrderedDumper, **kwds)
return yaml.dump(data=dump, stream=stream, Dumper=OrderedDumper, **kwds)


class AddProcessName(logging.Filter):
Expand Down
1 change: 0 additions & 1 deletion jarvis/modules/conditions/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def keyword_mapping() -> OrderedDict[str, List[str]]:
],
system_info=["configuration", "system config"],
ip_info=["address"],
wikipedia_=["wikipedia", "info", "information"],
news=["news"],
report=["report"],
robinhood=["robinhood", "investment", "portfolio", "summary"],
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Hardware :: Hardware Drivers",
"Topic :: System :: Hardware :: Symmetric Multi-processing",
"Topic :: System :: Hardware :: Universal Serial Bus (USB) :: Human Interface Device (HID)",
"Framework :: AnyIO",
"Framework :: FastAPI",
"Framework :: AsyncIO",
"Framework :: Sphinx",
"Framework :: Pydantic :: 2",
"Framework :: Setuptools Plugin",
"Framework :: aiohttp",
"Natural Language :: English"
]
Expand Down

0 comments on commit ec28fe9

Please sign in to comment.