Skip to content

Commit

Permalink
Add options to include custom icons in notifications
Browse files Browse the repository at this point in the history
Add OS specific dependencies in pyproject.toml
Bump version, update README.md and release_notes.rst
  • Loading branch information
dormant-user committed Jan 10, 2023
1 parent 5ea7808 commit fc9203a
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 22 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ notify(title="Test title", message="Test message")
```

### Optional arguments
- **debug**: Display logs on progress.
- **logger**: Bring your own [`Logger`](https://docs.python.org/3/library/logging.html#logging.Logger)
- **icon:** Custom icon to be used for `Linux` and `Windows` operating systems.
- Linux: Choose any [pre-defined icons](https://wiki.ubuntu.com/Artwork/BreatheIconSet/Icons) or a `.png` file as icon.
- Windows: Choose any `.ico` file as icon. Defaults to [notification.ico](https://github.com/thevickypedia/pynotification/tree/main/notifier/notification.ico)
- **destroy:** Boolean value to destroy the notification box on `Windows` operating system after notifying.
- **debug:** Display logs in the form of `info`, `warnings` and `errors` messages.
- **logger:** Bring your own [`Logger`](https://docs.python.org/3/library/logging.html#logging.Logger) for custom logging.

## Coding Standards
Docstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>
Expand Down
11 changes: 9 additions & 2 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,15 @@ <h2>Usage<a class="headerlink" href="#usage" title="Permalink to this heading">
<section id="optional-arguments">
<h2>Optional arguments<a class="headerlink" href="#optional-arguments" title="Permalink to this heading"></a></h2>
<ul class="simple">
<li><p><strong>debug</strong>: Display logs on progress.</p></li>
<li><p><strong>logger</strong>: Bring your own <a class="reference external" href="https://docs.python.org/3/library/logging.html#logging.Logger"><code class="docutils literal notranslate"><span class="pre">Logger</span></code></a></p></li>
<li><p><strong>icon:</strong> Custom icon to be used for <code class="docutils literal notranslate"><span class="pre">Linux</span></code> and <code class="docutils literal notranslate"><span class="pre">Windows</span></code> operating systems.</p>
<ul>
<li><p>Linux: Choose any <a class="reference external" href="https://wiki.ubuntu.com/Artwork/BreatheIconSet/Icons">pre-defined icons</a> or a <code class="docutils literal notranslate"><span class="pre">.png</span></code> file as icon.</p></li>
<li><p>Windows: Choose any <code class="docutils literal notranslate"><span class="pre">.ico</span></code> file as icon. Defaults to <a class="reference external" href="https://github.com/thevickypedia/pynotification/tree/main/notifier/notification.ico">notification.ico</a></p></li>
</ul>
</li>
<li><p><strong>destroy:</strong> Boolean value to destroy the notification box on <code class="docutils literal notranslate"><span class="pre">Windows</span></code> operating system after notifying.</p></li>
<li><p><strong>debug:</strong> Display logs in the form of <code class="docutils literal notranslate"><span class="pre">info</span></code>, <code class="docutils literal notranslate"><span class="pre">warnings</span></code> and <code class="docutils literal notranslate"><span class="pre">errors</span></code> messages.</p></li>
<li><p><strong>logger:</strong> Bring your own <a class="reference external" href="https://docs.python.org/3/library/logging.html#logging.Logger"><code class="docutils literal notranslate"><span class="pre">Logger</span></code></a> for custom logging.</p></li>
</ul>
</section>
<section id="coding-standards">
Expand Down
8 changes: 6 additions & 2 deletions docs/_sources/README.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ notify(title="Test title", message="Test message")
```

### Optional arguments
- **debug**: Display logs on progress.
- **logger**: Bring your own [`Logger`](https://docs.python.org/3/library/logging.html#logging.Logger)
- **icon:** Custom icon to be used for `Linux` and `Windows` operating systems.
- Linux: Choose any [pre-defined icons](https://wiki.ubuntu.com/Artwork/BreatheIconSet/Icons) or a `.png` file as icon.
- Windows: Choose any `.ico` file as icon. Defaults to [notification.ico](https://github.com/thevickypedia/pynotification/tree/main/notifier/notification.ico)
- **destroy:** Boolean value to destroy the notification box on `Windows` operating system after notifying.
- **debug:** Display logs in the form of `info`, `warnings` and `errors` messages.
- **logger:** Bring your own [`Logger`](https://docs.python.org/3/library/logging.html#logging.Logger) for custom logging.

## Coding Standards
Docstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>
Expand Down
19 changes: 16 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,32 @@ <h1>——–PyNotification——–<a class="headerlink" href="#pynotification"

<dl class="py function">
<dt class="sig sig-object py" id="notifier.notify.notify">
<span class="sig-prename descclassname"><span class="pre">notifier.notify.</span></span><span class="sig-name descname"><span class="pre">notify</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">title</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">AnyStr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">message</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">AnyStr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">debug</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">logger</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Logger</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</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">NoReturn</span></span></span><a class="headerlink" href="#notifier.notify.notify" title="Permalink to this definition"></a></dt>
<span class="sig-prename descclassname"><span class="pre">notifier.notify.</span></span><span class="sig-name descname"><span class="pre">notify</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">title</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">AnyStr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">message</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">AnyStr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">icon</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">PathLike</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">debug</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">logger</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">Logger</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">destroy</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</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">NoReturn</span></span></span><a class="headerlink" href="#notifier.notify.notify" title="Permalink to this definition"></a></dt>
<dd><p>Triggers a system notification.</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>title</strong> – Title for the notification.</p></li>
<li><p><strong>message</strong> – Message that has to go in the notification window.</p></li>
<li><p><strong>icon</strong> – Add a custom icon for Linux or Windows OS.</p></li>
<li><p><strong>debug</strong> – Boolean value to show output logs.</p></li>
<li><p><strong>logger</strong> – BYOL (bring your own logger method) to log in any defined fashion.</p></li>
<li><p><strong>logger</strong> – Bring your own logger for custom logging.</p></li>
<li><p><strong>destroy</strong> – Destroy notification balloon immediately on Windows OS.</p></li>
</ul>
</dd>
</dl>
<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>
<li><p>Both Linux and Windows OS support custom icon file for notifications.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">.png</span></code> for Linux</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">.ico</span></code> for Windows</p></li>
</ul>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<ul class="simple">
<li><p>Please note that using this module doesn’t guarantee a pop-up notification.</p></li>
<li><p>This module uses built-in tools to trigger a notification.</p></li>
<li><p>How the notification is displayed solely relies on the system settings.</p></li>
Expand All @@ -115,7 +126,7 @@ <h1>——–PyNotification——–<a class="headerlink" href="#pynotification"
</div>
<dl class="py class">
<dt class="sig sig-object py" id="notifier.mod.WindowsBalloonTip">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">notifier.mod.</span></span><span class="sig-name descname"><span class="pre">WindowsBalloonTip</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">title</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">destroy</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#notifier.mod.WindowsBalloonTip" title="Permalink to this definition"></a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">notifier.mod.</span></span><span class="sig-name descname"><span class="pre">WindowsBalloonTip</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">title</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">msg</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">icon</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Union</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">PathLike</span><span class="p"><span class="pre">]</span></span></span></em>, <em class="sig-param"><span class="n"><span class="pre">debug</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">logger</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Logger</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">destroy</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#notifier.mod.WindowsBalloonTip" title="Permalink to this definition"></a></dt>
<dd><p>Instantiates WindowsBalloonTip object as a dedicated process to trigger notification in Windows OS.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">WindowsBalloonTip</span>
</pre></div>
Expand All @@ -126,6 +137,8 @@ <h1>——–PyNotification——–<a class="headerlink" href="#pynotification"
<dd class="field-odd"><ul class="simple">
<li><p><strong>title</strong> – Title of the notification.</p></li>
<li><p><strong>msg</strong> – Message for the notification.</p></li>
<li><p><strong>debug</strong> – Boolean value to show output logs.</p></li>
<li><p><strong>logger</strong> – Bring your own logger to log in any fashion.</p></li>
<li><p><strong>destroy</strong> – Destroy notification balloon immediately.</p></li>
</ul>
</dd>
Expand Down
Loading

0 comments on commit fc9203a

Please sign in to comment.