Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -119,14 +119,15 @@ def parse_json(inp):
|
|
119 |
print("PARSE INPUT")
|
120 |
print(inp)
|
121 |
if type(inp)==type(""):
|
|
|
|
|
122 |
lines=""
|
123 |
if "```" in inp:
|
124 |
start = inp.find("```json") + 7
|
125 |
end = inp.find("```", start)
|
126 |
if start >= 0 and end >= 0:
|
127 |
inp= inp[start:end]
|
128 |
-
|
129 |
-
inp="NONE"
|
130 |
print("Extracted Lines")
|
131 |
print(inp)
|
132 |
try:
|
@@ -138,6 +139,7 @@ def parse_json(inp):
|
|
138 |
print(e)
|
139 |
return "None","None"
|
140 |
if type(inp)==type({}):
|
|
|
141 |
out1=str(inp['filename'])
|
142 |
out2=str(inp['filecontent'])
|
143 |
return out1,out2
|
|
|
119 |
print("PARSE INPUT")
|
120 |
print(inp)
|
121 |
if type(inp)==type(""):
|
122 |
+
print("STRING-------")
|
123 |
+
|
124 |
lines=""
|
125 |
if "```" in inp:
|
126 |
start = inp.find("```json") + 7
|
127 |
end = inp.find("```", start)
|
128 |
if start >= 0 and end >= 0:
|
129 |
inp= inp[start:end]
|
130 |
+
|
|
|
131 |
print("Extracted Lines")
|
132 |
print(inp)
|
133 |
try:
|
|
|
139 |
print(e)
|
140 |
return "None","None"
|
141 |
if type(inp)==type({}):
|
142 |
+
print("DICT-------")
|
143 |
out1=str(inp['filename'])
|
144 |
out2=str(inp['filecontent'])
|
145 |
return out1,out2
|