broadfield commited on
Commit
17e29c4
·
verified ·
1 Parent(s): 74a3294

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -139,9 +139,9 @@ def parse_json(inp):
139
  start = inp.find("```json") + 1 # Find index after the start character
140
  end = inp.find("```", start) # Find index of end character from the start index
141
  if start >= 0 and end >= 0:
142
- json1= inp[start:end] # Slice the string between start and end
143
  else:
144
- json1="NONE" # Return None if characters not found
145
  '''tog=False
146
  cnt=0
147
  for line in inp.split("\n"):
@@ -155,9 +155,9 @@ def parse_json(inp):
155
  elif cnt==2:
156
  tog = False'''
157
  print("Extracted Lines")
158
- print(json1)
159
  try:
160
- out_json=eval(json1)
161
  out1=str(out_json['filename'])
162
  out2=str(out_json['filecontent'])
163
  return out1,out2
 
139
  start = inp.find("```json") + 1 # Find index after the start character
140
  end = inp.find("```", start) # Find index of end character from the start index
141
  if start >= 0 and end >= 0:
142
+ inp= inp[start:end] # Slice the string between start and end
143
  else:
144
+ inp="NONE" # Return None if characters not found
145
  '''tog=False
146
  cnt=0
147
  for line in inp.split("\n"):
 
155
  elif cnt==2:
156
  tog = False'''
157
  print("Extracted Lines")
158
+ print(inp)
159
  try:
160
+ out_json=eval(inp)
161
  out1=str(out_json['filename'])
162
  out2=str(out_json['filecontent'])
163
  return out1,out2