Some fixes for flake8

This commit is contained in:
ZyX 2013-04-06 18:55:41 +04:00
parent e68bae6409
commit b1fecebd53
4 changed files with 3 additions and 5 deletions

View File

@ -1,7 +1,6 @@
# vim:fileencoding=utf-8:noet # vim:fileencoding=utf-8:noet
from __future__ import absolute_import from __future__ import absolute_import
import json
import os import os
import sys import sys
import logging import logging

View File

@ -56,7 +56,7 @@ class ConfigLoader(MultiRunnedThread):
'''Register any function that will be called with given key each '''Register any function that will be called with given key each
interval seconds (interval is defined at __init__). Its result is then interval seconds (interval is defined at __init__). Its result is then
passed to ``function``, but only if the result is true. passed to ``function``, but only if the result is true.
:param function condition_function: :param function condition_function:
Function which will be called each ``interval`` seconds. All Function which will be called each ``interval`` seconds. All
exceptions from it will be ignored. exceptions from it will be ignored.
@ -79,7 +79,6 @@ class ConfigLoader(MultiRunnedThread):
:param set removed_functions: :param set removed_functions:
Set of functions previously passed to ``.register()`` method. Set of functions previously passed to ``.register()`` method.
''' '''
removes = []
with self.lock: with self.lock:
for path, functions in list(self.watched.items()): for path, functions in list(self.watched.items()):
functions -= removed_functions functions -= removed_functions
@ -127,7 +126,6 @@ class ConfigLoader(MultiRunnedThread):
function(path) function(path)
with self.lock: with self.lock:
for key, functions in list(self.missing.items()): for key, functions in list(self.missing.items()):
remove = False
for condition_function, function in list(functions): for condition_function, function in list(functions):
try: try:
path = condition_function(key) path = condition_function(key)

View File

@ -18,8 +18,10 @@ from powerline.lib.humanize_bytes import humanize_bytes
from powerline.theme import requires_segment_info from powerline.theme import requires_segment_info
from collections import namedtuple from collections import namedtuple
cpu_count = None cpu_count = None
@requires_segment_info @requires_segment_info
def hostname(pl, segment_info, only_if_ssh=False, exclude_domain=False): def hostname(pl, segment_info, only_if_ssh=False, exclude_domain=False):
'''Return the current hostname. '''Return the current hostname.

View File

@ -6,7 +6,6 @@ from tests import TestCase
from tests.lib import replace_item from tests.lib import replace_item
from tests.lib.config_mock import swap_attributes, get_powerline, pop_events from tests.lib.config_mock import swap_attributes, get_powerline, pop_events
from copy import deepcopy from copy import deepcopy
from threading import Lock
config = { config = {