From cdbb2f3e36c17a88a9c449a8fe51d64eb7f79d33 Mon Sep 17 00:00:00 2001 From: enkore Date: Wed, 9 Oct 2013 09:58:38 +0200 Subject: [PATCH] While we're at it, some other PEP8 stuff. [obama] Except too long lines, because big screens. --- .idea/misc.xml | 17 ----------------- README.md | 8 ++++---- i3pystatus/alsa.py | 2 +- i3pystatus/battery.py | 2 +- i3pystatus/clock.py | 8 ++++++-- i3pystatus/disk.py | 2 -- i3pystatus/mail/imap.py | 2 +- i3pystatus/mem.py | 9 +++++---- i3pystatus/modsde.py | 2 +- i3pystatus/pyload.py | 2 +- i3pystatus/runwatch.py | 2 +- 11 files changed, 21 insertions(+), 35 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 3c29b2c..f11dfb9 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,22 +1,5 @@ - - diff --git a/README.md b/README.md index 71aec39..532f07c 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ Available formatters: * `{volume}` — the current volume in percent * `{muted}` — the value of one of the `muted` or `unmuted` settings * `{card}` — the associated soundcard -* `{mixer}` — the associated ALSA mixer +* `{mixer}` — the associated ALSA mixer __Settings:__ @@ -297,7 +297,7 @@ __Settings:__ * `alert_format_title` — The title of the notification, all formatters can be used (default: `Low battery`) * `alert_format_body` — The body text of the notification, all formatters can be used (default: `Battery {battery_ident} has only {percentage:.2f}% ({remaining:%E%hh:%Mm}) remaining!`) * `path` — Override the default-generated path (default: `None`) -* `status` — A dictionary mapping ('DIS', 'CHR', 'FULL') to alternative names (default: `{'FULL': 'FULL', 'DIS': 'DIS', 'CHR': 'CHR'}`) +* `status` — A dictionary mapping ('DIS', 'CHR', 'FULL') to alternative names (default: `{'DIS': 'DIS', 'CHR': 'CHR', 'FULL': 'FULL'}`) @@ -503,7 +503,7 @@ __Settings:__ * `host` — (default: `localhost`) * `port` — MPD port (default: `6600`) * `format` — formatp string (default: `{title} {status}`) -* `status` — Dictionary mapping pause, play and stop to output (default: `{'pause': '▷', 'stop': '◾', 'play': '▶'}`) +* `status` — Dictionary mapping pause, play and stop to output (default: `{'stop': '◾', 'play': '▶', 'pause': '▷'}`) @@ -619,7 +619,7 @@ __Settings:__ Expands the given path using glob to a pidfile and checks if the process ID found inside is valid (that is, if the process is running). -You can use this to check if a specific application, +You can use this to check if a specific application, such as a VPN client or your DHCP client is running. Available formatters are {pid} and {name}. diff --git a/i3pystatus/alsa.py b/i3pystatus/alsa.py index 613becf..2b71f27 100644 --- a/i3pystatus/alsa.py +++ b/i3pystatus/alsa.py @@ -15,7 +15,7 @@ class ALSA(IntervalModule): * `{volume}` — the current volume in percent * `{muted}` — the value of one of the `muted` or `unmuted` settings * `{card}` — the associated soundcard - * `{mixer}` — the associated ALSA mixer + * `{mixer}` — the associated ALSA mixer """ interval = 1 diff --git a/i3pystatus/battery.py b/i3pystatus/battery.py index ccb8b8a..8acf257 100644 --- a/i3pystatus/battery.py +++ b/i3pystatus/battery.py @@ -91,7 +91,7 @@ class BatteryEnergy(Battery): class BatteryChecker(IntervalModule): - """ + """ This class uses the /sys/class/power_supply/…/uevent interface to check for the battery status diff --git a/i3pystatus/clock.py b/i3pystatus/clock.py index 6518192..2656ddb 100644 --- a/i3pystatus/clock.py +++ b/i3pystatus/clock.py @@ -1,12 +1,16 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import os, locale, datetime +import os +import locale +import datetime from i3pystatus import IntervalModule + class Clock(IntervalModule): - """ + + """ This class shows a clock """ diff --git a/i3pystatus/disk.py b/i3pystatus/disk.py index d91354b..ddbe673 100644 --- a/i3pystatus/disk.py +++ b/i3pystatus/disk.py @@ -23,8 +23,6 @@ class Disk(IntervalModule): divisor = 1024 ** 3 def run(self): - cdict = {} - stat = os.statvfs(self.path) cdict = { "total": (stat.f_bsize * stat.f_blocks) / self.divisor, diff --git a/i3pystatus/mail/imap.py b/i3pystatus/mail/imap.py index e8a79f7..760a739 100644 --- a/i3pystatus/mail/imap.py +++ b/i3pystatus/mail/imap.py @@ -11,7 +11,7 @@ from i3pystatus.mail import Backend class IMAP(Backend): - """ + """ Checks for mail on a IMAP server """ diff --git a/i3pystatus/mem.py b/i3pystatus/mem.py index c19309d..0f92b58 100644 --- a/i3pystatus/mem.py +++ b/i3pystatus/mem.py @@ -3,6 +3,7 @@ from psutil import virtual_memory MEGABYTE = 1024**2 + class Mem(IntervalModule): """ Shows memory load @@ -24,9 +25,9 @@ class Mem(IntervalModule): def run(self): vm = virtual_memory() self.output = { - "full_text" : self.format.format( - used_mem=int(round(vm.used/MEGABYTE, 0)), - avail_mem=int(round(vm.available/MEGABYTE, 0)), - total_mem=int(round(vm.total/MEGABYTE, 0)), + "full_text": self.format.format( + used_mem=int(round(vm.used / MEGABYTE, 0)), + avail_mem=int(round(vm.available / MEGABYTE, 0)), + total_mem=int(round(vm.total / MEGABYTE, 0)), percent_used_mem=vm.percent) } diff --git a/i3pystatus/modsde.py b/i3pystatus/modsde.py index d56ddc6..701b274 100644 --- a/i3pystatus/modsde.py +++ b/i3pystatus/modsde.py @@ -17,7 +17,7 @@ from i3pystatus import IntervalModule class ModsDeChecker(IntervalModule): - """ + """ This class returns i3status parsable output of the number of unread posts in any bookmark in the mods.de forums. """ diff --git a/i3pystatus/pyload.py b/i3pystatus/pyload.py index 773fb3c..79c9789 100644 --- a/i3pystatus/pyload.py +++ b/i3pystatus/pyload.py @@ -73,7 +73,7 @@ class pyLoad(IntervalModule): "download": self.download_true if server_status["download"] else self.download_false, "speed": server_status["speed"] / 1024, "progress": progress, - "progress_all": sum(pkg["linksdone"] for pkg in self._rpc_call("getQueue")) / server_status["total"] * 100, + "progress_all": sum(pkg["linksdone"] for pkg in self._rpc_call("getQueue")) / server_status["total"] * 100, "captcha": self.captcha_true if self._rpc_call("isCaptchaWaiting") else self.captcha_false, "free_space": self._rpc_call("freeSpace") / (1024 ** 3), } diff --git a/i3pystatus/runwatch.py b/i3pystatus/runwatch.py index 28bb641..f0f384c 100644 --- a/i3pystatus/runwatch.py +++ b/i3pystatus/runwatch.py @@ -10,7 +10,7 @@ class RunWatch(IntervalModule): Expands the given path using glob to a pidfile and checks if the process ID found inside is valid (that is, if the process is running). - You can use this to check if a specific application, + You can use this to check if a specific application, such as a VPN client or your DHCP client is running. Available formatters are {pid} and {name}.