Commits

Sergey Kirillov  committed a94f1fa Draft

Updated

  • Participants
  • Parent commits 89eb2e0

Comments (0)

Files changed (1)

File multitail.py

-#!/usr/bin/python
+"""Python generator which implements `tail -f`-like behaviour, with support for tailing multiple files."""
 
 import time
 import os
 
 
 def tail(filename):
-    return multitail(filename)
-
+    """Simple "tail -f"-like tailer""" 
+    for _, line in filename:
+        yield line
+        
 
 def multitail(filenames):
+    """ Simple "tail -f"-like tailer for multiple files
+        
+        Yields pairs (filename, line)
+    """ 
     files = [_TailedFile(x).ensure_exists() for x in filenames]
     for f in files:
         f.seek_end()