From 7d48a00b1e3d0b78fec629de0c23011a41e8f13a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Mand=C3=A1k?= Date: Tue, 2 Jun 2015 22:49:12 +0200 Subject: [PATCH] Updated docs. --- docs/i3pystatus.rst | 13 +++++++++++-- i3pystatus/updates/__init__.py | 32 +++++++++++++++++++------------- i3pystatus/updates/cower.py | 3 ++- i3pystatus/updates/pacman.py | 5 ++--- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/docs/i3pystatus.rst b/docs/i3pystatus.rst index 80637a5..dacbbb7 100644 --- a/docs/i3pystatus.rst +++ b/docs/i3pystatus.rst @@ -7,10 +7,10 @@ Module reference :System: `clock`_ - `disk`_ - `load`_ - `mem`_ - `cpu_usage`_ :Audio: `alsa`_ - `pulseaudio`_ :Hardware: `battery`_ - `backlight`_ - `temp`_ -:Network: `network`_ +:Network: `network`_ :Music: `now_playing`_ - `mpd`_ :Websites & stuff: `weather`_ - `bitcoin`_ - `reddit`_ - `parcel`_ -:Other: `mail`_ - `pyload`_ - `text`_ +:Other: `mail`_ - `pyload`_ - `text`_ - `updates`_ :Advanced: `file`_ - `regex`_ - `runwatch`_ - `shell`_ .. autogen:: i3pystatus Module @@ -25,3 +25,12 @@ Mail Backends .. autogen:: i3pystatus.mail SettingsBase .. nothin' + +.. _updatebackends: + +Update Backends +--------------- + +.. autogen:: i3pystatus.updates SettingsBase + + .. nothin' diff --git a/i3pystatus/updates/__init__.py b/i3pystatus/updates/__init__.py index 60f83f5..a1b62d7 100644 --- a/i3pystatus/updates/__init__.py +++ b/i3pystatus/updates/__init__.py @@ -2,33 +2,39 @@ from i3pystatus import SettingsBase, IntervalModule, formatp class Backend(SettingsBase): - """ - TODO: doc - """ - + settings = () updates = 0 class Updates(IntervalModule): """ - Generic update checker + Generic update checker. + To use select appropriate backend(s) for your system. + For list of all available backends see :ref:`updatebackends`. + + Left clicking on the module will refresh the count of upgradeable packages. + This may be used to dismiss the notification after updating your system. + + .. rubric:: Available formatters + + * `{count}` — Sum of all available updates from all backends. - TODO: doc """ - interval = 60 * 5 # 5 minutes + interval = 3600 settings = ( - ("backends", "List of backends used to check for updates."), - ("format", ""), - ("format_no_updates", ""), - ("color", ""), - ("color_no_updates", ""), + ("backends", "Required list of backends used to check for updates."), + ("format", "String shown when updates are availible. May contain formatters."), + ("format_no_updates", "String that is shown if no updates are available. If not set the module will be hidden if no updates are available."), + "color", + "color_no_updates", + ("interval", "Default interval is set to one hour."), ) required = ("backends",) backends = None - format = "U {count}" + format = "Updates: {count}" format_no_updates = None color = "#00DD00" color_no_updates = "#FFFFFF" diff --git a/i3pystatus/updates/cower.py b/i3pystatus/updates/cower.py index aad1650..3c67c56 100644 --- a/i3pystatus/updates/cower.py +++ b/i3pystatus/updates/cower.py @@ -1,11 +1,12 @@ from i3pystatus.core.command import run_through_shell - from i3pystatus.updates import Backend class Cower(Backend): """ Checks for updates in Arch User Repositories using the `cower` AUR helper. + + Depends on cower AUR agent - https://github.com/falconindy/cower """ @property diff --git a/i3pystatus/updates/pacman.py b/i3pystatus/updates/pacman.py index 96e56ac..bc6f2aa 100644 --- a/i3pystatus/updates/pacman.py +++ b/i3pystatus/updates/pacman.py @@ -1,12 +1,11 @@ from i3pystatus.core.command import run_through_shell - from i3pystatus.updates import Backend class Pacman(Backend): """ - Checks for updates in Arch Linux pacman repositories using the - `checkupdates` script. + Checks for updates in Arch Linux repositories using the + `checkupdates` script which is part of the `pacman` package. """ @property