diff --git a/docs/module_docs.py b/docs/module_docs.py index e53a10a..a067f57 100644 --- a/docs/module_docs.py +++ b/docs/module_docs.py @@ -52,9 +52,10 @@ def process_docstring(app, what, name, obj, options, lines): if self.default is self.empty: attrs.append("default: *empty*") - formatted = "* **{name}** – {doc}".format(name=self.name, doc=self.doc) - if attrs: - formatted += " ({attrs})".format(attrs=", ".join(attrs)) + formatted = "* **{name}** {attrsf} {doc}".format( + name=self.name, + doc="– " + self.doc if self.doc else "", + attrsf=" ({attrs})".format(attrs=", ".join(attrs)) if attrs else "") return formatted @@ -65,13 +66,15 @@ def process_docstring(app, what, name, obj, options, lines): for setting in obj.settings: lines.append(str(Setting(obj, setting))) + lines.append("") + def process_signature(app, what, name, obj, options, signature, return_annotation): if is_module(obj): return ("", return_annotation) -def get_modules(path): +def get_modules(path, name): modules = [] for finder, modname, is_package in pkgutil.iter_modules(path): if modname not in IGNORE_MODULES: @@ -84,12 +87,12 @@ def get_module(finder, modname): return (modname, finder.find_loader(fullname)[0].load_module(fullname)) -def get_all(module_path, basecls): +def get_all(module_path, modname, basecls): mods = [] finder = ClassFinder(basecls) - for name, module in get_modules(module_path): + for name, module in get_modules(module_path, modname): classes = finder.get_matching_classes(module) found = [] for cls in classes: @@ -100,8 +103,8 @@ def get_all(module_path, basecls): return sorted(mods, key=lambda module: module[0]) -def generate_automodules(path, basecls): - modules = get_all(path, basecls) +def generate_automodules(path, name, basecls): + modules = get_all(path, name, basecls) contents = [] @@ -133,7 +136,7 @@ class AutogenDirective(Directive): for e in self.content: contents.append(e) contents.append("") - contents.extend(generate_automodules(modpath, basecls)) + contents.extend(generate_automodules(modpath, modname, basecls)) node = paragraph() self.state.nested_parse(StringList(contents), 0, node) diff --git a/i3pystatus/mail/__init__.py b/i3pystatus/mail/__init__.py index c028e39..56f1556 100644 --- a/i3pystatus/mail/__init__.py +++ b/i3pystatus/mail/__init__.py @@ -17,16 +17,19 @@ class Mail(IntervalModule): """ Generic mail checker - The `backends` setting determines the backends to use. For available backends see :ref:`mailbackends` + The `backends` setting determines the backends to use. For available backends see :ref:`mailbackends`. """ - _endstring = """!!i3pystatus.mail!!""" - settings = ( - ("backends", "List of backends (instances of ``i3pystatus.mail.xxx.zzz``, i.e. ``i3pystatus.mail.imap.IMAP``)"), + ("backends", "List of backends (instances of ``i3pystatus.mail.xxx.zzz``, e.g. :py:class:`.imap.IMAP`)"), "color", "color_unread", "format", "format_plural", ("hide_if_null", "Don't output anything if there are no new mails"), - ("email_client", "The email client to open on left click"), + ("email_client", "The command to run on left click. " + "For example, to launch Thunderbird set command_on_click to ``thunderbird``. " + "Alternatively, to bring Thunderbird into focus, " + "set command_on_click to ``i3-msg -q [class=\"^Thunderbird$\"] focus``. " + "Hint: To discover the X window class of your email client run 'xprop | grep -i class' " + "and click on it's window\n"), ) required = ("backends",)