more debugging stuff
This commit is contained in:
@@ -267,7 +267,7 @@ def strokeDataToDf(strokeData):
|
||||
|
||||
return df
|
||||
|
||||
def readlogs_summaries(logfile): # pragma: no cover
|
||||
def readlogs_summaries(logfile,dosave=0): # pragma: no cover
|
||||
with open(logfile,'r') as f:
|
||||
while f:
|
||||
s = f.readline()
|
||||
@@ -275,17 +275,30 @@ def readlogs_summaries(logfile): # pragma: no cover
|
||||
break
|
||||
if "Importing" in s:
|
||||
words = s.split(" ")
|
||||
nkid = words[-1]
|
||||
print(nkid)
|
||||
nkid = words[-1][0:6]
|
||||
print(nkid,dosave)
|
||||
print('')
|
||||
line1 = f.readline()
|
||||
line2 = f.readline()
|
||||
|
||||
data1 = line1[line1.find('{'):]
|
||||
data2 = line2[line2.find('['):]
|
||||
|
||||
strokeData = json.loads(data2)
|
||||
summaryData = json.loads(data1)
|
||||
try:
|
||||
strokeData = json.loads(data2)
|
||||
summaryData = json.loads(data1)
|
||||
df = strokeDataToDf(strokeData)
|
||||
|
||||
df = strokeDataToDf(strokeData)
|
||||
|
||||
print(get_nk_allstats(summaryData,df))
|
||||
if dosave == 0 or str(nkid) == str(dosave):
|
||||
print(get_nk_allstats(summaryData,df))
|
||||
print(summaryData)
|
||||
if str(dosave) == str(nkid):
|
||||
print('saving')
|
||||
filename = 'strokedata_{id}.json'.format(id=nkid)
|
||||
filename2 = 'nk_summarydata_{id}.json'.format(id=nkid)
|
||||
with open(filename,'w') as f2:
|
||||
json.dump(strokeData,f2)
|
||||
with open(filename2,'w') as f2:
|
||||
json.dump(summaryData,f2)
|
||||
except:
|
||||
print("error")
|
||||
|
||||
Reference in New Issue
Block a user