| version 1.13, 2008/03/10 14:39:38 |
version 1.14, 2008/09/17 16:55:30 |
|
|
| # |
# |
| # pgloader librairies |
# pgloader librairies |
| |
|
| import os, sys, os.path, time, codecs, collections |
import os, sys, os.path, time, codecs |
| from cStringIO import StringIO |
from cStringIO import StringIO |
| |
|
| from options import DRY_RUN, PEDANTIC |
from options import DRY_RUN, PEDANTIC |
| Line 194 def check_events(events, log, context = |
|
| Line 194 def check_events(events, log, context = |
|
| log.debug("thread %s %s" % (t, context)) |
log.debug("thread %s %s" % (t, context)) |
| |
|
| return |
return |
| |
|
| class RRReader(collections.deque): |
|
| """ Round Robin reader, which are collections.deque with a |
|
| readlines() method""" |
|
| |
|
| def readlines(self): |
|
| """ return next line from queue """ |
|
| while 1: |
|
| try: |
|
| yield self.popleft() |
|
| except IndexError: |
|
| return |
|