more debugging stuff
This commit is contained in:
@@ -267,7 +267,7 @@ def strokeDataToDf(strokeData):
|
|||||||
|
|
||||||
return df
|
return df
|
||||||
|
|
||||||
def readlogs_summaries(logfile): # pragma: no cover
|
def readlogs_summaries(logfile,dosave=0): # pragma: no cover
|
||||||
with open(logfile,'r') as f:
|
with open(logfile,'r') as f:
|
||||||
while f:
|
while f:
|
||||||
s = f.readline()
|
s = f.readline()
|
||||||
@@ -275,17 +275,30 @@ def readlogs_summaries(logfile): # pragma: no cover
|
|||||||
break
|
break
|
||||||
if "Importing" in s:
|
if "Importing" in s:
|
||||||
words = s.split(" ")
|
words = s.split(" ")
|
||||||
nkid = words[-1]
|
nkid = words[-1][0:6]
|
||||||
print(nkid)
|
print(nkid,dosave)
|
||||||
|
print('')
|
||||||
line1 = f.readline()
|
line1 = f.readline()
|
||||||
line2 = f.readline()
|
line2 = f.readline()
|
||||||
|
|
||||||
data1 = line1[line1.find('{'):]
|
data1 = line1[line1.find('{'):]
|
||||||
data2 = line2[line2.find('['):]
|
data2 = line2[line2.find('['):]
|
||||||
|
|
||||||
|
try:
|
||||||
strokeData = json.loads(data2)
|
strokeData = json.loads(data2)
|
||||||
summaryData = json.loads(data1)
|
summaryData = json.loads(data1)
|
||||||
|
|
||||||
df = strokeDataToDf(strokeData)
|
df = strokeDataToDf(strokeData)
|
||||||
|
|
||||||
|
if dosave == 0 or str(nkid) == str(dosave):
|
||||||
print(get_nk_allstats(summaryData,df))
|
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