From 025e7286860bec749f6567271948a39ed03cb85d Mon Sep 17 00:00:00 2001 From: nolash Date: Fri, 9 Apr 2021 12:45:25 +0200 Subject: [PATCH] WIP handle input parse --- eth_stat_syncer/store.py | 15 ++++++++++++++- requirements.txt | 5 +++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/eth_stat_syncer/store.py b/eth_stat_syncer/store.py index 4ee369b..fbb839e 100644 --- a/eth_stat_syncer/store.py +++ b/eth_stat_syncer/store.py @@ -12,9 +12,14 @@ class RunStore: self.procstore = os.path.join(basedir, 'eth_stat_syncerd') + def get_postfix_path(self, name, postfix): + file_path = os.path.join(self.procstore, postfix, name) + return file_path + + def put(self, o, postfix): for k in o: - file_path = os.path.join(self.procstore, postfix, k) + file_path = self.get_postfix_path(k, postfix) d = os.path.dirname(file_path) try: os.stat(d) @@ -25,6 +30,14 @@ class RunStore: f.close() + def get(self, name, postfix): + file_path = self.get_postfix_path(name, postfix) + f = open(file_path, 'r') + r = f.read() + f.close() + return r + + class GasAggregator: def __init__(self, store, capacity): diff --git a/requirements.txt b/requirements.txt index 12739a8..8e59c07 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ -chainsyncer==0.0.1a22 -chainlib==0.0.2a6 +chainsyncer~=0.0.1a22 +chainlib~=0.0.2a6 +jsonrpc_std~=0.0.1a1