diff --git a/tail.py b/tail.py index c9e4fc2..028cfc2 100644 --- a/tail.py +++ b/tail.py @@ -12,7 +12,7 @@ t = tail.Tail('file-to-be-followed') # Register a callback function to be called when a new line is found in the followed file. - # If no callback function is registerd, new lines would be printed to standard out. + # If no callback function is registered, new lines would be printed to standard out. t.register_callback(callback_function) # Follow the file with 5 seconds as sleep time between iterations. @@ -54,9 +54,9 @@ def follow(self, s=1): line = file_.readline() if not line: file_.seek(curr_position) + time.sleep(s) else: self.callback(line) - time.sleep(s) def register_callback(self, func): ''' Overrides default callback function to provided function. '''