Spaces:
Runtime error
Runtime error
Update InitialMarkups.py
Browse files- InitialMarkups.py +3 -2
InitialMarkups.py
CHANGED
|
@@ -40,7 +40,7 @@ import copy
|
|
| 40 |
import urllib.parse
|
| 41 |
|
| 42 |
def changepdflinks(data_list_JSON, pdflink):
|
| 43 |
-
print('Received JSON:', data_list_JSON)
|
| 44 |
|
| 45 |
# Ensure list of dicts
|
| 46 |
if isinstance(data_list_JSON, str):
|
|
@@ -55,6 +55,7 @@ def changepdflinks(data_list_JSON, pdflink):
|
|
| 55 |
|
| 56 |
for entry in data_list_JSON:
|
| 57 |
old_url = entry.get("NBSLink", "")
|
|
|
|
| 58 |
if not old_url:
|
| 59 |
continue
|
| 60 |
|
|
@@ -70,7 +71,7 @@ def changepdflinks(data_list_JSON, pdflink):
|
|
| 70 |
new_url = f"https://findconsole-initialmarkups.hf.space/view-pdf?pdfLink={encoded_pdf}#{fragment}"
|
| 71 |
else:
|
| 72 |
new_url = f"https://findconsole-initialmarkups.hf.space/view-pdf?pdfLink={encoded_pdf}"
|
| 73 |
-
|
| 74 |
print("New URL:", new_url)
|
| 75 |
entry["NBSLink"] = new_url
|
| 76 |
|
|
|
|
| 40 |
import urllib.parse
|
| 41 |
|
| 42 |
def changepdflinks(data_list_JSON, pdflink):
|
| 43 |
+
print('Received JSON:', data_list_JSON,pdflink)
|
| 44 |
|
| 45 |
# Ensure list of dicts
|
| 46 |
if isinstance(data_list_JSON, str):
|
|
|
|
| 55 |
|
| 56 |
for entry in data_list_JSON:
|
| 57 |
old_url = entry.get("NBSLink", "")
|
| 58 |
+
print('old_url',old_url)
|
| 59 |
if not old_url:
|
| 60 |
continue
|
| 61 |
|
|
|
|
| 71 |
new_url = f"https://findconsole-initialmarkups.hf.space/view-pdf?pdfLink={encoded_pdf}#{fragment}"
|
| 72 |
else:
|
| 73 |
new_url = f"https://findconsole-initialmarkups.hf.space/view-pdf?pdfLink={encoded_pdf}"
|
| 74 |
+
print('urlsent:',pdflink)
|
| 75 |
print("New URL:", new_url)
|
| 76 |
entry["NBSLink"] = new_url
|
| 77 |
|