While we're at it, some other PEP8 stuff.

[obama] Except too long lines, because big screens.
This commit is contained in:
enkore 2013-10-09 09:58:38 +02:00
parent d63896d465
commit cdbb2f3e36
11 changed files with 21 additions and 35 deletions

17
.idea/misc.xml generated
View File

@ -1,22 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.3.2 (/usr/bin/python3.3)" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.3.2 (/usr/bin/python3.3)" project-jdk-type="Python SDK" />
<component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false" SSL_PROTOCOLS="all">
<option name="USER" value="" />
<option name="PASSWORD" value="" />
<option name="mySSHConnectionTimeout" value="30000" />
<option name="mySSHReadTimeout" value="30000" />
<option name="LAST_MERGED_REVISION" />
<option name="MERGE_DRY_RUN" value="false" />
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<option name="FORCE_UPDATE" value="false" />
<option name="IGNORE_EXTERNALS" value="false" />
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
</component>
</project> </project>

View File

@ -236,7 +236,7 @@ Available formatters:
* `{volume}` — the current volume in percent * `{volume}` — the current volume in percent
* `{muted}` — the value of one of the `muted` or `unmuted` settings * `{muted}` — the value of one of the `muted` or `unmuted` settings
* `{card}` — the associated soundcard * `{card}` — the associated soundcard
* `{mixer}` — the associated ALSA mixer * `{mixer}` — the associated ALSA mixer
__Settings:__ __Settings:__
@ -297,7 +297,7 @@ __Settings:__
* `alert_format_title` — The title of the notification, all formatters can be used (default: `Low battery`) * `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!`) * `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`) * `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`) * `host` — (default: `localhost`)
* `port` — MPD port (default: `6600`) * `port` — MPD port (default: `6600`)
* `format` — formatp string (default: `{title} {status}`) * `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 Expands the given path using glob to a pidfile and checks
if the process ID found inside is valid if the process ID found inside is valid
(that is, if the process is running). (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. such as a VPN client or your DHCP client is running.
Available formatters are {pid} and {name}. Available formatters are {pid} and {name}.

View File

@ -15,7 +15,7 @@ class ALSA(IntervalModule):
* `{volume}` the current volume in percent * `{volume}` the current volume in percent
* `{muted}` the value of one of the `muted` or `unmuted` settings * `{muted}` the value of one of the `muted` or `unmuted` settings
* `{card}` the associated soundcard * `{card}` the associated soundcard
* `{mixer}` the associated ALSA mixer * `{mixer}` the associated ALSA mixer
""" """
interval = 1 interval = 1

View File

@ -91,7 +91,7 @@ class BatteryEnergy(Battery):
class BatteryChecker(IntervalModule): class BatteryChecker(IntervalModule):
""" """
This class uses the /sys/class/power_supply//uevent 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

@ -1,12 +1,16 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os, locale, datetime import os
import locale
import datetime
from i3pystatus import IntervalModule from i3pystatus import IntervalModule
class Clock(IntervalModule): class Clock(IntervalModule):
"""
"""
This class shows a clock This class shows a clock
""" """

View File

@ -23,8 +23,6 @@ class Disk(IntervalModule):
divisor = 1024 ** 3 divisor = 1024 ** 3
def run(self): def run(self):
cdict = {}
stat = os.statvfs(self.path) stat = os.statvfs(self.path)
cdict = { cdict = {
"total": (stat.f_bsize * stat.f_blocks) / self.divisor, "total": (stat.f_bsize * stat.f_blocks) / self.divisor,

View File

@ -11,7 +11,7 @@ from i3pystatus.mail import Backend
class IMAP(Backend): class IMAP(Backend):
""" """
Checks for mail on a IMAP server Checks for mail on a IMAP server
""" """

View File

@ -3,6 +3,7 @@ from psutil import virtual_memory
MEGABYTE = 1024**2 MEGABYTE = 1024**2
class Mem(IntervalModule): class Mem(IntervalModule):
""" """
Shows memory load Shows memory load
@ -24,9 +25,9 @@ class Mem(IntervalModule):
def run(self): def run(self):
vm = virtual_memory() vm = virtual_memory()
self.output = { self.output = {
"full_text" : self.format.format( "full_text": self.format.format(
used_mem=int(round(vm.used/MEGABYTE, 0)), used_mem=int(round(vm.used / MEGABYTE, 0)),
avail_mem=int(round(vm.available/MEGABYTE, 0)), avail_mem=int(round(vm.available / MEGABYTE, 0)),
total_mem=int(round(vm.total/MEGABYTE, 0)), total_mem=int(round(vm.total / MEGABYTE, 0)),
percent_used_mem=vm.percent) percent_used_mem=vm.percent)
} }

View File

@ -17,7 +17,7 @@ from i3pystatus import IntervalModule
class ModsDeChecker(IntervalModule): class ModsDeChecker(IntervalModule):
""" """
This class returns i3status parsable output of the number of This class returns i3status parsable output of the number of
unread posts in any bookmark in the mods.de forums. unread posts in any bookmark in the mods.de forums.
""" """

View File

@ -73,7 +73,7 @@ class pyLoad(IntervalModule):
"download": self.download_true if server_status["download"] else self.download_false, "download": self.download_true if server_status["download"] else self.download_false,
"speed": server_status["speed"] / 1024, "speed": server_status["speed"] / 1024,
"progress": progress, "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, "captcha": self.captcha_true if self._rpc_call("isCaptchaWaiting") else self.captcha_false,
"free_space": self._rpc_call("freeSpace") / (1024 ** 3), "free_space": self._rpc_call("freeSpace") / (1024 ** 3),
} }

View File

@ -10,7 +10,7 @@ class RunWatch(IntervalModule):
Expands the given path using glob to a pidfile and checks Expands the given path using glob to a pidfile and checks
if the process ID found inside is valid if the process ID found inside is valid
(that is, if the process is running). (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. such as a VPN client or your DHCP client is running.
Available formatters are {pid} and {name}. Available formatters are {pid} and {name}.