From 35e0433a6eadce8071de5a62882b2c186dc05c4a Mon Sep 17 00:00:00 2001 From: fawce Date: Wed, 8 Aug 2012 00:46:19 -0400 Subject: [PATCH 1/2] added LOG as valid prefix. --- zipline/protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zipline/protocol.py b/zipline/protocol.py index bbf80f98..b5bf67ae 100644 --- a/zipline/protocol.py +++ b/zipline/protocol.py @@ -131,7 +131,7 @@ from utils.date_utils import EPOCH, UN_EPOCH, epoch_now # Control Protocol # ----------------------- -PRODUCTION_PREFIXES = ['PERF', 'RISK', 'EXCEPTION', 'CANCEL'] +PRODUCTION_PREFIXES = ['PERF', 'RISK', 'EXCEPTION','CANCEL','DONE', 'LOG'] INVALID_CONTROL_FRAME = FrameExceptionFactory('CONTROL') From 7b340af890c97168cb625b96b64af327d3002efd Mon Sep 17 00:00:00 2001 From: fawce Date: Wed, 8 Aug 2012 11:19:26 -0400 Subject: [PATCH 2/2] leaky abstractions...patched --- zipline/gens/returns.py | 1 - zipline/lines.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/zipline/gens/returns.py b/zipline/gens/returns.py index ccfc7b00..49d3e9b5 100644 --- a/zipline/gens/returns.py +++ b/zipline/gens/returns.py @@ -1,5 +1,4 @@ from collections import defaultdict, deque -from zipline.transforms.base import BaseTransform class Returns(object): """ diff --git a/zipline/lines.py b/zipline/lines.py index 0fa990ca..5bb50f68 100644 --- a/zipline/lines.py +++ b/zipline/lines.py @@ -144,7 +144,7 @@ class SimulatedTrading(object): data_injector = Processor(inject_event_data) log_pipeline = NestedSetup([self.zmq_out,data_injector]) - with log_pipeline.threadbound(), self.stdout_capture(self.logger, ''): + with log_pipeline.threadbound(), self.stdout_capture(Logger('Print'), ''): self.stream_results() # if no log socket, just run the algo normally else: @@ -234,7 +234,6 @@ class SimulatedTrading(object): socket = sock, ) - # This is a class, which is instantiated later # in run_algorithm. The class provides a generator. self.stdout_capture = stdout_only_pipe