From 7f498f760bb2910411587bc1bc00897949167ed7 Mon Sep 17 00:00:00 2001 From: TonyFord <tonyford@strategy-investor.de> Date: Wed, 23 Jun 2021 11:27:56 +0200 Subject: [PATCH] fix --- git_import.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/git_import.py b/git_import.py index b07b696..671e322 100644 --- a/git_import.py +++ b/git_import.py @@ -2,7 +2,7 @@ import os import hashlib import sys import yaml -import datetime +from datetime import datetime QPATH='./services/jekyll/_site/queue' TPATH='./services/jekyll/_data/orderbook' @@ -37,7 +37,7 @@ def getRepoYml(): continue with open( RPATH + '/' + y, 'r') as stream: try: - u=yaml.safe_load(stream) + u=yaml.safe_load(stream)yaml.dump(a, explicit_start=True, default_flow_style=False) if( u == None ): continue @@ -45,7 +45,7 @@ def getRepoYml(): print( 'field "bid-ask" not found but mandatory, ' + y + ' skipped!' ) continue - if( not 'condition' in u ): + if( not 'condition' in u ):yaml.dump(a, explicit_start=True, default_flow_style=False) u['condition']='2-used-mint' if( not 'min' in u ): @@ -83,7 +83,8 @@ def getRepoYml(): u['time'] = datetime.timestamp print(y+' validated successfully') - os.system( 'mv '+ RPATH + '/'+y+' ' + TPATH + '/' + uname + '/' ) + open( TPATH + '/' + uname + '/' + y, 'w').write( yaml.dump(u, explicit_start=True, default_flow_style=False) ) + # os.system( 'mv '+ RPATH + '/'+y+' ' + TPATH + '/' + uname + '/' ) except yaml.YAMLError as exc: print(y+' invalid') -- GitLab