This commit is contained in:
enkore 2013-02-24 22:40:29 +01:00
parent a89b421ebb
commit 582a35e412
5 changed files with 17 additions and 11 deletions

View File

@ -36,6 +36,9 @@ as you like.
## Modules ## Modules
Many modules let you modify the output via a
[format string](http://docs.python.org/3/library/string.html#formatstrings).
### backlight ### backlight
@ -57,7 +60,7 @@ Available formatters:
### battery ### 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 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. of all components). The return value is bound to the key.
* `format`format string * `format` (required)
* `components`List of tripels * `components` (required)
* `transforms` — List of pairs * `transforms`
* `base_path` — (default: `/`) * `base_path` — (default: `/`)
* `color` — (default: `#FFFFFF`) * `color` — (default: `#FFFFFF`)
* `interval` — (default: `5`) * `interval` — (default: `5`)

View File

@ -36,6 +36,9 @@ as you like.
## Modules ## Modules
Many modules let you modify the output via a
[format string](http://docs.python.org/3/library/string.html#formatstrings).
!!module_doc!! !!module_doc!!
## Contribute ## Contribute

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from i3pystatus import IntervalModule from . import IntervalModule
from .core.util import PrefixedKeyDict from .core.util import PrefixedKeyDict
class Battery: class Battery:
@ -54,7 +54,7 @@ class RemainingCalculator:
class BatteryChecker(IntervalModule): 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 battery status
""" """

View File

@ -21,10 +21,10 @@ class File(IntervalModule):
""" """
settings = ( settings = (
("format", "format string"), "format",
("components", "List of tripels"), "components",
("transforms", "List of pairs"), "transforms",
("base_path", ""), "base_path",
"color", "interval", "color", "interval",
) )
required = ("format", "components") required = ("format", "components")

View File

@ -130,7 +130,7 @@ def get_all(module_path, heading, finder=None):
def generate_doc_for_module(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))) 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 = template.read()
tpl = tpl.replace("!!module_doc!!", generate_doc_for_module(i3pystatus.__path__)) tpl = tpl.replace("!!module_doc!!", generate_doc_for_module(i3pystatus.__path__))