Skip to content

Commit 59e3302

Browse files
committed
apply PEP8 code style
Signed-off-by: hwassman <[email protected]>
1 parent ceb4b47 commit 59e3302

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

source/watcher.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class ConfigWatcher(object):
3131
running = False
3232
refresh_delay_secs = 1
3333

34-
# Constructor
3534
def __init__(self, watch_paths, call_func_on_change=None, *args, **kwargs):
3635
self._cached_stamp = {}
3736
self.logger = getBridgeLogger()
@@ -41,7 +40,6 @@ def __init__(self, watch_paths, call_func_on_change=None, *args, **kwargs):
4140
self.args = args
4241
self.kwargs = kwargs
4342

44-
4543
def update_files_list(self):
4644
oldfiles = self.filenames.copy()
4745
for path in self.paths:
@@ -57,9 +55,8 @@ def update_files_list(self):
5755
for file in self.filenames.difference(oldfiles):
5856
self.logger.debug(MSG['FileAddedToWatch'].format(file))
5957

60-
61-
# Look for changes
6258
def look(self):
59+
""" Function to check if a file timestamp has changed"""
6360
for filename in self.filenames:
6461
stamp = os.stat(filename).st_mtime
6562
if filename not in self._cached_stamp:
@@ -71,8 +68,8 @@ def look(self):
7168
if self.call_func_on_change is not None:
7269
self.call_func_on_change(*self.args, **self.kwargs)
7370

74-
# Keep watching in a loop
7571
def watch(self):
72+
""" Function to keep watching in a loop """
7673
self.running = True
7774
self.logger.debug(MSG['StartWatchingFiles'].format(self.paths))
7875
while self.running:
@@ -93,8 +90,6 @@ def watch(self):
9390
self.logger.details(MSG['UnhandledError'].format(type(e).__name__))
9491
break
9592

96-
97-
# break watching
9893
def stop_watch(self):
94+
""" Function to break watching """
9995
self.running = False
100-

tests/test_configWatcher.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import time
33
from source.watcher import ConfigWatcher
44
from source.bridgeLogger import configureLogging
5-
from source.__version__ import __version__ as version
65
from nose2.tools.such import helper as assert_helper
76
from nose2.tools.decorators import with_setup
87
from threading import Thread

0 commit comments

Comments
 (0)