changeset 1825:738bb2ec6b7f

partially reverted changeset 1820, the code WAS used
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 25 Feb 2007 19:17:10 +0100
parents 45b228d4e550
children b6389701c31d
files MoinMoin/logfile/__init__.py
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/logfile/__init__.py	Sun Feb 25 18:58:40 2007 +0100
+++ b/MoinMoin/logfile/__init__.py	Sun Feb 25 19:17:10 2007 +0100
@@ -120,7 +120,16 @@
         """
         generate some attributes when needed
         """
-        if name == "_input":
+        if name == "_LogFile__rel_index": # Python black magic: this is the real name of the __rel_index attribute
+            # starting iteration from begin
+            self.__buffer1 = LineBuffer(self._input, 0, self.buffer_size)
+            self.__buffer2 = LineBuffer(self._input,
+                                        self.__buffer1.offsets[-1],
+                                        self.buffer_size)
+            self.__buffer = self.__buffer1
+            self.__rel_index = 0
+            return 0
+        elif name == "_input":
             try:
                 # Open the file (NOT using codecs.open, it breaks our offset calculation. We decode it later.).
                 # Use binary mode in order to retain \r - otherwise the offset calculation would fail.