diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-04-08 00:53:34 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-04-08 00:53:34 +0200 |
commit | c8df27385e02b22d36b240fe29532e97dbba1f43 (patch) | |
tree | 44d7f9089468f35277bb8d0257da0f3a3bb88448 /market.py | |
parent | e6015816224f8f405e9b1c9557f22e73b21246e8 (diff) | |
parent | 1d72880c097ea8259ce9cc63cfe55e6cc7516bd2 (diff) | |
download | Trader-c8df27385e02b22d36b240fe29532e97dbba1f43.tar.gz Trader-c8df27385e02b22d36b240fe29532e97dbba1f43.tar.zst Trader-c8df27385e02b22d36b240fe29532e97dbba1f43.zip |
Merge branch 'test_cleanup' into dev
Diffstat (limited to 'market.py')
-rw-r--r-- | market.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -5,6 +5,7 @@ import psycopg2 | |||
5 | from store import * | 5 | from store import * |
6 | from cachetools.func import ttl_cache | 6 | from cachetools.func import ttl_cache |
7 | from datetime import datetime | 7 | from datetime import datetime |
8 | import datetime | ||
8 | from retry import retry | 9 | from retry import retry |
9 | import portfolio | 10 | import portfolio |
10 | 11 | ||
@@ -28,7 +29,7 @@ class Market: | |||
28 | for key in ["user_id", "market_id", "pg_config"]: | 29 | for key in ["user_id", "market_id", "pg_config"]: |
29 | setattr(self, key, kwargs.get(key, None)) | 30 | setattr(self, key, kwargs.get(key, None)) |
30 | 31 | ||
31 | self.report.log_market(self.args, self.user_id, self.market_id) | 32 | self.report.log_market(self.args) |
32 | 33 | ||
33 | @classmethod | 34 | @classmethod |
34 | def from_config(cls, config, args, **kwargs): | 35 | def from_config(cls, config, args, **kwargs): |
@@ -40,7 +41,7 @@ class Market: | |||
40 | 41 | ||
41 | def store_report(self): | 42 | def store_report(self): |
42 | self.report.merge(Portfolio.report) | 43 | self.report.merge(Portfolio.report) |
43 | date = datetime.now() | 44 | date = datetime.datetime.now() |
44 | if self.args.report_path is not None: | 45 | if self.args.report_path is not None: |
45 | self.store_file_report(date) | 46 | self.store_file_report(date) |
46 | if self.pg_config is not None and self.args.report_db: | 47 | if self.pg_config is not None and self.args.report_db: |