From 582a35e412c6f994d04695e58ba427844f722bdd Mon Sep 17 00:00:00 2001 From: enkore Date: Sun, 24 Feb 2013 22:40:29 +0100 Subject: [PATCH] . --- README.md | 11 +++++++---- template.md => README.tpl.md | 3 +++ i3pystatus/battery.py | 4 ++-- i3pystatus/file.py | 8 ++++---- i3pystatus/mkdocs.py | 2 +- 5 files changed, 17 insertions(+), 11 deletions(-) rename template.md => README.tpl.md (92%) diff --git a/README.md b/README.md index 4e34420..cbf208d 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,9 @@ as you like. ## Modules +Many modules let you modify the output via a +[format string](http://docs.python.org/3/library/string.html#formatstrings). + ### backlight @@ -57,7 +60,7 @@ Available formatters: ### battery -This class uses the /proc/acpi/battery interface to check for the +This class uses the /sys/class/power_supply/…/uevent interface to check for the battery status @@ -95,9 +98,9 @@ transforms is a optional dict of callables taking a single argument (a dictionar of all components). The return value is bound to the key. -* `format` — format string -* `components` — List of tripels -* `transforms` — List of pairs +* `format` — (required) +* `components` — (required) +* `transforms` * `base_path` — (default: `/`) * `color` — (default: `#FFFFFF`) * `interval` — (default: `5`) diff --git a/template.md b/README.tpl.md similarity index 92% rename from template.md rename to README.tpl.md index 72803c8..79e35f0 100644 --- a/template.md +++ b/README.tpl.md @@ -36,6 +36,9 @@ as you like. ## Modules +Many modules let you modify the output via a +[format string](http://docs.python.org/3/library/string.html#formatstrings). + !!module_doc!! ## Contribute diff --git a/i3pystatus/battery.py b/i3pystatus/battery.py index 1bbc086..005cbb0 100644 --- a/i3pystatus/battery.py +++ b/i3pystatus/battery.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from i3pystatus import IntervalModule +from . import IntervalModule from .core.util import PrefixedKeyDict class Battery: @@ -54,7 +54,7 @@ class RemainingCalculator: class BatteryChecker(IntervalModule): """ - This class uses the /proc/acpi/battery interface to check for the + This class uses the /sys/class/power_supply/…/uevent interface to check for the battery status """ diff --git a/i3pystatus/file.py b/i3pystatus/file.py index 193f339..4c15f42 100644 --- a/i3pystatus/file.py +++ b/i3pystatus/file.py @@ -21,10 +21,10 @@ class File(IntervalModule): """ settings = ( - ("format", "format string"), - ("components", "List of tripels"), - ("transforms", "List of pairs"), - ("base_path", ""), + "format", + "components", + "transforms", + "base_path", "color", "interval", ) required = ("format", "components") diff --git a/i3pystatus/mkdocs.py b/i3pystatus/mkdocs.py index a720002..5d0fd04 100755 --- a/i3pystatus/mkdocs.py +++ b/i3pystatus/mkdocs.py @@ -130,7 +130,7 @@ def get_all(module_path, heading, finder=None): def generate_doc_for_module(module_path, heading="###", finder=None): return "".join(map(str, get_all(module_path, heading, finder))) -with open("template.md", "r") as template: +with open("README.tpl.md", "r") as template: tpl = template.read() tpl = tpl.replace("!!module_doc!!", generate_doc_for_module(i3pystatus.__path__))