11import sys
22import os
33import pdfrw
4- from pdfrw .findobjs import find_objects
54from pdfrw import PdfReader
65from pathlib import Path
7- import csv
86from time import mktime , strptime
97from datetime import datetime
108from fractions import Fraction
@@ -173,7 +171,9 @@ def markup_space(self, markup, page_index, spaces_vertices):
173171 true_check += 1
174172 if (true_check == len (poly_points )):
175173 markup_spaces .append (key )
176- return (markup_spaces )
174+ return (markup_spaces )
175+ else :
176+ return
177177
178178 def feet_inches_convert (self , text ):
179179 feet , sep , inches = text .rpartition ("\' " )
@@ -198,7 +198,7 @@ def measurement_col(self, markup):
198198 measurements = []
199199 if ("sf" in str (self .content_hex_convert (markup ['/Contents' ]))):
200200 sf_measure = self .content_hex_convert (markup ['/Contents' ]).split (' ' )
201- measurements .append (sf_measure [0 ], sf_measure [1 ])
201+ measurements .append ([ sf_measure [0 ], sf_measure [1 ] ])
202202 elif (markup ['/IT' ] == "/PolygonCount" ):
203203 measurements .append ([1 , "ct" ])
204204 elif (markup ['/IT' ] in lf_columns ):
@@ -315,10 +315,12 @@ def markups(self, column_list="default"):
315315 row_dict ['Type' ] = measurements [1 ]
316316 elif (column == "Type" ):
317317 pass
318- # Disabling spaces until it is fixed.
319- elif ("Space" in column ):
320- spaces_join = '-' .join (self .markup_space (markup , markup_index [markup .NM ], spaces_vertices ))
321- row_dict ['Space' ] = spaces_join
318+ elif ("Space" in column ):
319+ try :
320+ spaces_join = '-' .join (self .markup_space (markup , markup_index [markup .NM ], spaces_vertices ))
321+ row_dict ['Space' ] = spaces_join
322+ except :
323+ pass
322324 elif (markup [column ] is not None ):
323325 row_dict [chosen_columns [column ]] = markup [column ][1 :- 1 ]
324326 else :
0 commit comments