New Upstream Release - python-notify2

Ready changes

Summary

Merged new upstream version: 0.3.1 (was: 0.3).

Resulting package

Built on 2022-11-20T09:35 (took 5m3s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-releases python3-notify2

Lintian Result

Diff

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..c5dac68
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,39 @@
+notify2 is under the BSD 2-Clause License.
+
+Some of the examples (icon.py, default-action.py, multi-actions.py and qt-app.py)
+are derived from pynotify examples, and are therefore `LGPL-2.1 <http://opensource.org/licenses/lgpl-2.1.php>`_,
+© 2006 Christian Hammond <chipx86@chipx86.com>.
+
+Contributors
+------------
+
+* Thomas Kluyver
+* John Terry
+
+License text
+------------
+
+Copyright (c) 2012, Thomas Kluyver & contributors
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this
+  list of conditions and the following disclaimer in the documentation and/or
+  other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/PKG-INFO b/PKG-INFO
index 4db1aea..abc8c06 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: notify2
-Version: 0.3
+Version: 0.3.1
 Summary: Python interface to DBus notifications
 Home-page: https://bitbucket.org/takluyver/pynotify2
 Author: Thomas Kluyver
@@ -18,7 +18,8 @@ Description: This is a pure-python replacement for notify-python, using python-d
                                     )
             n.show()
         
-        To see more of what's possible, refer to docstrings of methods and objects.
+        API docs are `available on ReadTheDocs <https://notify2.readthedocs.org/en/latest/>`_,
+        or you can refer to docstrings.
         
         Based on the notifications spec at:
         http://developer.gnome.org/notification-spec/
diff --git a/debian/changelog b/debian/changelog
index 1cb17f3..ae2c876 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-notify2 (0.3.1-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Sun, 20 Nov 2022 09:31:14 -0000
+
 python-notify2 (0.3-5) unstable; urgency=low
 
   [ Debian Janitor ]
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..b7e9853
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  texinfo    to make Texinfo files"
+	@echo "  info       to make Texinfo files and run them through makeinfo"
+	@echo "  gettext    to make PO message catalogs"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/notify2.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/notify2.qhc"
+
+devhelp:
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/notify2"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/notify2"
+	@echo "# devhelp"
+
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	$(MAKE) -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo
+	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+	@echo "Run \`make' in that directory to run these through makeinfo" \
+	      "(use \`make info' here to do that automatically)."
+
+info:
+	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+	@echo "Running Texinfo files through makeinfo..."
+	make -C $(BUILDDIR)/texinfo info
+	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+	@echo
+	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..c1148f1
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,253 @@
+# -*- coding: utf-8 -*-
+#
+# notify2 documentation build configuration file, created by
+# sphinx-quickstart on Fri Jun 14 11:35:07 2013.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# To get docstrings, we need to be able to import dbus, but we don't need to
+# actually use it.
+try:
+    import dbus
+except ImportError:
+    sys.modules['dbus'] = object()
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'notify2'
+copyright = u'2013, Thomas Kluyver'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.3'
+# The full version, including alpha/beta/rc tags.
+release = '0.3'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'notify2doc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'notify2.tex', u'notify2 Documentation',
+   u'Thomas Kluyver', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    ('index', 'notify2', u'notify2 Documentation',
+     [u'Thomas Kluyver'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+#  dir menu entry, description, category)
+texinfo_documents = [
+  ('index', 'notify2', u'notify2 Documentation',
+   u'Thomas Kluyver', 'notify2', 'One line description of project.',
+   'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+
+# Example configuration for intersphinx: refer to the Python standard library.
+intersphinx_mapping = {'http://docs.python.org/': None}
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..8774637
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,96 @@
+notify2 API documentation
+=========================
+
+notify2 is a replacement for pynotify which can be used from different GUI toolkits
+and from programs without a GUI. The API is largely the same as that of pynotify,
+but some less important parts are left out.
+
+You can alternatively use the GObject Introspection bindings to libnotify
+(``from gi.repository import Notify``). I'd recommend that for GTK applications,
+while notify2 has fewer dependencies for non-GTK applications. It should be easy
+to switch between the two.
+
+Notifications are sent to a notification daemon over `D-Bus <http://www.freedesktop.org/wiki/Software/dbus/>`_,
+according to the `Desktop notifications spec <http://people.gnome.org/~mccann/docs/notification-spec/notification-spec-latest.html>`_,
+and the server is responsible for displaying them to the user. So your application
+has limited control over when and how a notification appears. For example,
+Ubuntu uses the `NotifyOSD daemon <https://wiki.ubuntu.com/NotifyOSD>`_.
+
+.. toctree::
+   :maxdepth: 1
+   
+   license
+
+.. module:: notify2
+
+.. autofunction:: init
+
+.. autofunction:: get_server_caps
+
+.. autofunction:: get_server_info
+
+Creating and showing notifications
+----------------------------------
+
+.. autoclass:: Notification
+
+   .. automethod:: show
+   
+   .. automethod:: update
+   
+   .. automethod:: close
+
+Extra parameters
+----------------
+
+.. class:: Notification
+
+   .. automethod:: set_urgency
+   
+   .. automethod:: set_timeout
+   
+   .. automethod:: set_category
+   
+   .. automethod:: set_location
+   
+   .. automethod:: set_icon_from_pixbuf
+   
+   .. automethod:: set_hint
+   
+   .. automethod:: set_hint_byte
+   
+Callbacks
+---------
+
+To receive callbacks, you must have set a D-Bus event loop when you called
+:func:`init`.
+
+.. class:: Notification
+
+   .. automethod:: connect
+   
+   .. automethod:: add_action
+   
+
+Constants
+---------
+
+.. data:: URGENCY_LOW
+          URGENCY_NORMAL
+          URGENCY_CRITICAL
+
+   Urgency levels to pass to :meth:`Notification.set_urgency`.
+
+.. data:: EXPIRES_DEFAULT
+          EXPIRES_NEVER
+
+   Special expiration times to pass to :meth:`Notification.set_timeout`.
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/docs/license.rst b/docs/license.rst
new file mode 100644
index 0000000..1af0492
--- /dev/null
+++ b/docs/license.rst
@@ -0,0 +1,42 @@
+License and Contributors
+========================
+
+notify2 is under the BSD 2-Clause License.
+
+Some of the examples (icon.py, default-action.py, multi-actions.py and qt-app.py)
+are derived from pynotify examples, and are therefore `LGPL-2.1 <http://opensource.org/licenses/lgpl-2.1.php>`_,
+© 2006 Christian Hammond <chipx86@chipx86.com>.
+
+Contributors
+------------
+
+* Thomas Kluyver
+* John Terry
+
+License text
+------------
+
+Copyright (c) 2012, Thomas Kluyver & contributors
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this
+  list of conditions and the following disclaimer in the documentation and/or
+  other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/docs/make.bat b/docs/make.bat
new file mode 100644
index 0000000..401d23c
--- /dev/null
+++ b/docs/make.bat
@@ -0,0 +1,190 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+	set SPHINXBUILD=sphinx-build
+)
+set BUILDDIR=_build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
+set I18NSPHINXOPTS=%SPHINXOPTS% .
+if NOT "%PAPER%" == "" (
+	set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+	set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+	:help
+	echo.Please use `make ^<target^>` where ^<target^> is one of
+	echo.  html       to make standalone HTML files
+	echo.  dirhtml    to make HTML files named index.html in directories
+	echo.  singlehtml to make a single large HTML file
+	echo.  pickle     to make pickle files
+	echo.  json       to make JSON files
+	echo.  htmlhelp   to make HTML files and a HTML help project
+	echo.  qthelp     to make HTML files and a qthelp project
+	echo.  devhelp    to make HTML files and a Devhelp project
+	echo.  epub       to make an epub
+	echo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter
+	echo.  text       to make text files
+	echo.  man        to make manual pages
+	echo.  texinfo    to make Texinfo files
+	echo.  gettext    to make PO message catalogs
+	echo.  changes    to make an overview over all changed/added/deprecated items
+	echo.  linkcheck  to check all external links for integrity
+	echo.  doctest    to run all doctests embedded in the documentation if enabled
+	goto end
+)
+
+if "%1" == "clean" (
+	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+	del /q /s %BUILDDIR%\*
+	goto end
+)
+
+if "%1" == "html" (
+	%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+	goto end
+)
+
+if "%1" == "dirhtml" (
+	%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+	goto end
+)
+
+if "%1" == "singlehtml" (
+	%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+	goto end
+)
+
+if "%1" == "pickle" (
+	%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can process the pickle files.
+	goto end
+)
+
+if "%1" == "json" (
+	%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can process the JSON files.
+	goto end
+)
+
+if "%1" == "htmlhelp" (
+	%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+	goto end
+)
+
+if "%1" == "qthelp" (
+	%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+	echo.^> qcollectiongenerator %BUILDDIR%\qthelp\notify2.qhcp
+	echo.To view the help file:
+	echo.^> assistant -collectionFile %BUILDDIR%\qthelp\notify2.ghc
+	goto end
+)
+
+if "%1" == "devhelp" (
+	%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished.
+	goto end
+)
+
+if "%1" == "epub" (
+	%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The epub file is in %BUILDDIR%/epub.
+	goto end
+)
+
+if "%1" == "latex" (
+	%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+	goto end
+)
+
+if "%1" == "text" (
+	%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The text files are in %BUILDDIR%/text.
+	goto end
+)
+
+if "%1" == "man" (
+	%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The manual pages are in %BUILDDIR%/man.
+	goto end
+)
+
+if "%1" == "texinfo" (
+	%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
+	goto end
+)
+
+if "%1" == "gettext" (
+	%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
+	goto end
+)
+
+if "%1" == "changes" (
+	%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.The overview file is in %BUILDDIR%/changes.
+	goto end
+)
+
+if "%1" == "linkcheck" (
+	%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+	goto end
+)
+
+if "%1" == "doctest" (
+	%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+	if errorlevel 1 exit /b 1
+	echo.
+	echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+	goto end
+)
+
+:end
diff --git a/examples/notify2.py b/examples/notify2.py
new file mode 120000
index 0000000..77bec87
--- /dev/null
+++ b/examples/notify2.py
@@ -0,0 +1 @@
+../notify2.py
\ No newline at end of file
diff --git a/notify2.py b/notify2.py
index 1b40269..3418e58 100644
--- a/notify2.py
+++ b/notify2.py
@@ -10,7 +10,8 @@ To use it, first call ``notify2.init('app name')``, then create and show notific
                             )
     n.show()
 
-To see more of what's possible, refer to docstrings of methods and objects.
+API docs are `available on ReadTheDocs <https://notify2.readthedocs.org/en/latest/>`_,
+or you can refer to docstrings.
 
 Based on the notifications spec at:
 http://developer.gnome.org/notification-spec/
@@ -37,6 +38,8 @@ for compatibility. You are encouraged to use more direct, Pythonic alternatives.
 
 import dbus
 
+__version__ = '0.3.1'
+
 # Constants
 EXPIRES_DEFAULT = -1
 EXPIRES_NEVER = 0
@@ -53,6 +56,9 @@ appname = ""
 _have_mainloop = False
 
 class UninittedError(RuntimeError):
+    """Error raised if you try to communicate with the server before calling
+    :func:`init`.
+    """
     pass
 
 class UninittedDbusObj(object):
@@ -63,7 +69,8 @@ class UninittedDbusObj(object):
 dbus_iface = UninittedDbusObj()
 
 def init(app_name, mainloop=None):
-    """Initialise the Dbus connection.
+    """Initialise the D-Bus connection. Must be called before you send any
+    notifications, or retrieve server info or capabilities.
     
     To get callbacks from notifications, DBus must be integrated with a mainloop.
     There are three ways to achieve this:
@@ -127,6 +134,9 @@ def uninit():
 
 def get_server_caps():
     """Get a list of server capabilities.
+    
+    These are short strings, listed `in the spec <http://people.gnome.org/~mccann/docs/notification-spec/notification-spec-latest.html#commands>`_.
+    Vendors may also list extra capabilities with an 'x-' prefix, e.g. 'x-canonical-append'.
     """
     return [str(x) for x in dbus_iface.GetCapabilities()]
 
@@ -146,12 +156,20 @@ notifications_registry = {}
 
 def _action_callback(nid, action):
     nid, action = int(nid), str(action)
-    n = notifications_registry[nid]
+    try:
+        n = notifications_registry[nid]
+    except KeyError:
+        #this message was created through some other program.
+        return
     n._action_callback(action)
 
 def _closed_callback(nid, reason):
     nid, reason = int(nid), int(reason)
-    n = notifications_registry[nid]
+    try:
+        n = notifications_registry[nid]
+    except KeyError:
+        #this message was created through some other program.
+        return
     n._closed_callback(n)
     del notifications_registry[nid]
 
@@ -162,7 +180,27 @@ def no_op(*args):
 
 # Controlling notifications ----------------------------------------------------
 
+ActionsDictClass = dict  # fallback for old version of Python
+try:
+    from collections import OrderedDict
+    ActionsDictClass = OrderedDict
+except ImportError:
+    pass
+
+
 class Notification(object):
+    """A notification object.
+    
+    summary : str
+      The title text
+    message : str
+      The body text, if the server has the 'body' capability.
+    icon : str
+      Path to an icon image, or the name of a stock icon. Stock icons available
+      in Ubuntu are `listed here <https://wiki.ubuntu.com/NotificationDevelopmentGuidelines#How_do_I_get_these_slick_icons>`_.
+      You can also set an icon from data in your application - see
+      :meth:`set_icon_from_pixbuf`.
+    """
     id = 0
     timeout = -1    # -1 = server default settings
     _closed_callback = no_op
@@ -172,11 +210,14 @@ class Notification(object):
         self.message = message
         self.icon = icon
         self.hints = {}
-        self.actions = {}
+        self.actions = ActionsDictClass()
         self.data = {}     # Any data the user wants to attach
     
     def show(self):
         """Ask the server to show the notification.
+        
+        Call this after you have finished setting any parameters of the
+        notification that you want.
         """
         nid = dbus_iface.Notify(appname,       # app_name       (spec names)
                               self.id,       # replaces_id
@@ -196,8 +237,8 @@ class Notification(object):
     
     def update(self, summary, message="", icon=None):
         """Replace the summary and body of the notification, and optionally its
-        icon. You should call show() again after this to display the updated
-        notification.
+        icon. You should call :meth:`show` again after this to display the
+        updated notification.
         """
         self.summary = summary
         self.message = message
@@ -205,14 +246,15 @@ class Notification(object):
             self.icon = icon
     
     def close(self):
-        """Ask the server to close this notification.
-        """
+        """Ask the server to close this notification."""
         if self.id != 0:
             dbus_iface.CloseNotification(self.id)
     
     def set_hint(self, key, value):
         """n.set_hint(key, value) <--> n.hints[key] = value
         
+        See `hints in the spec <http://people.gnome.org/~mccann/docs/notification-spec/notification-spec-latest.html#hints>`_.
+        
         Only exists for compatibility with pynotify.
         """
         self.hints[key] = value
@@ -235,12 +277,15 @@ class Notification(object):
     
     def set_category(self, category):
         """Set the 'category' hint for this notification.
+        
+        See `categories in the spec <http://people.gnome.org/~mccann/docs/notification-spec/notification-spec-latest.html#categories>`_.
         """
         self.hints['category'] = category
     
     def set_timeout(self, timeout):
         """Set the display duration in milliseconds, or one of the special
-        values EXPIRES_DEFAULT or EXPIRES_NEVER.
+        values EXPIRES_DEFAULT or EXPIRES_NEVER. This is a request, which the
+        server might ignore.
         
         Only exists for compatibility with pynotify; you can simply set::
         
@@ -259,7 +304,9 @@ class Notification(object):
         return self.timeout
     
     def add_action(self, action, label, callback, user_data=None):
-        """Add an action to the notification (if the server supports it).
+        """Add an action to the notification.
+        
+        Check for the 'actions' server capability before using this.
         
         action : str
           A brief key.
@@ -298,7 +345,9 @@ class Notification(object):
     
     def connect(self, event, callback):
         """Set the callback for the notification closing; the only valid value
-        for event is 'closed'. The API is compatible with pynotify.
+        for event is 'closed' (the parameter is kept for compatibility with pynotify).
+        
+        The callback will be called with the :class:`Notification` instance.
         """
         if event != 'closed':
             raise ValueError("'closed' is the only valid value for event", event)
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..3c6e79c
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,2 @@
+[bdist_wheel]
+universal=1
diff --git a/setup.py b/setup.py
index 70bfdbc..a0b21d5 100644
--- a/setup.py
+++ b/setup.py
@@ -1,9 +1,18 @@
 from distutils.core import setup
+
+# To load the docstring, we need to be able to import dbus, but we don't
+# actually use it.
+try:
+    import dbus
+except ImportError:
+    import sys
+    sys.modules['dbus'] = object()
+
 import notify2
 long_description = notify2.__doc__
 
 setup(name='notify2',
-      version='0.3',
+      version='0.3.1',
       description='Python interface to DBus notifications',
       long_description=long_description,
       author='Thomas Kluyver',

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/lib/python3/dist-packages/notify2-0.3.1.egg-info
lrwxrwxrwx  root/root   /usr/share/doc/python3-notify2/examples/notify2.py -> ../notify2.py

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/lib/python3/dist-packages/notify2-0.3.egg-info

No differences were encountered in the control files

More details

Full run details