WIP handle input parse

This commit is contained in:
nolash 2021-04-09 12:45:25 +02:00
parent 84e89dbfae
commit 025e728686
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 17 additions and 3 deletions

View File

@ -12,9 +12,14 @@ class RunStore:
self.procstore = os.path.join(basedir, 'eth_stat_syncerd') 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): def put(self, o, postfix):
for k in o: 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) d = os.path.dirname(file_path)
try: try:
os.stat(d) os.stat(d)
@ -25,6 +30,14 @@ class RunStore:
f.close() 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: class GasAggregator:
def __init__(self, store, capacity): def __init__(self, store, capacity):

View File

@ -1,2 +1,3 @@
chainsyncer==0.0.1a22 chainsyncer~=0.0.1a22
chainlib==0.0.2a6 chainlib~=0.0.2a6
jsonrpc_std~=0.0.1a1