Marthee commited on
Commit
89e34b1
·
verified ·
1 Parent(s): 62c950f

Update InitialMarkups.py

Browse files
Files changed (1) hide show
  1. InitialMarkups.py +4 -1
InitialMarkups.py CHANGED
@@ -36,12 +36,14 @@ def filteredJsons(pdf_path,filteredjsonsfromrawan):
36
 
37
 
38
 
39
-
40
  def changepdflinks(data_list_JSON, pdflink):
41
  print('henaaaa weee')
 
42
  # If the input is a JSON string, convert it to a Python list
43
  if isinstance(data_list_JSON, str):
44
  data_list_JSON = json.loads(data_list_JSON)
 
 
45
 
46
  # Loop through all entries and update their NBSLink
47
  for entry in data_list_JSON:
@@ -67,6 +69,7 @@ def changepdflinks(data_list_JSON, pdflink):
67
  entry["NBSLink"] = new_url
68
 
69
  return data_list_JSON
 
70
 
71
  def get_regular_font_size_and_color(doc):
72
  font_sizes = []
 
36
 
37
 
38
 
 
39
  def changepdflinks(data_list_JSON, pdflink):
40
  print('henaaaa weee')
41
+
42
  # If the input is a JSON string, convert it to a Python list
43
  if isinstance(data_list_JSON, str):
44
  data_list_JSON = json.loads(data_list_JSON)
45
+ elif not isinstance(data_list_JSON, list):
46
+ raise ValueError("Input must be a JSON string or a Python list")
47
 
48
  # Loop through all entries and update their NBSLink
49
  for entry in data_list_JSON:
 
69
  entry["NBSLink"] = new_url
70
 
71
  return data_list_JSON
72
+
73
 
74
  def get_regular_font_size_and_color(doc):
75
  font_sizes = []