More autotest tweaks.

pull/1/head
Yusuke Shinyama 2014-06-15 10:52:59 +09:00
parent 1384a3fe8d
commit a8ec99a848
4 changed files with 17 additions and 20 deletions

View File

@ -19,8 +19,9 @@ clean:
-$(RM) -r build dist MANIFEST
-cd $(PACKAGE) && $(MAKE) clean
-cd tools && $(MAKE) clean
-cd samples && $(MAKE) clean
distclean: clean test_clean cmap_clean
distclean: clean cmap_clean
sdist: distclean MANIFEST.in
$(PYTHON) setup.py sdist
@ -53,7 +54,7 @@ $(CMAPDST)/to-unicode-Adobe-Korea1.pickle.gz: $(CMAPDST)
$(CONV_CMAP) -c KSC-EUC=euc-kr -c KSC-Johab=johab -c KSCms-UHC=cp949 -c UniKS-UTF8=utf-8 \
$(CMAPDST) Adobe-Korea1 $(CMAPSRC)/cid2code_Adobe_Korea1.txt
unittest:
test: cmap
$(PYTHON) -m doctest \
pdfminer/arcfour.py \
pdfminer/lzw.py \
@ -62,8 +63,4 @@ unittest:
pdfminer/rijndael.py
$(PYTHON) pdfminer/ccitt.py
$(PYTHON) pdfminer/psparser.py
test: cmap
cd samples && $(MAKE) clean test
test_clean:
-cd samples && $(MAKE) clean

View File

@ -615,7 +615,8 @@ class LTLayoutContainer(LTContainer):
for j in xrange(i+1, len(boxes)):
obj2 = boxes[j]
dists.append((0, dist(obj1, obj2), obj1, obj2))
dists.sort()
# We could use dists.sort(), but it would randomize the test result.
dists = csort(dists)
plane = Plane(self.bbox)
plane.extend(boxes)
while dists:
@ -630,11 +631,10 @@ class LTLayoutContainer(LTContainer):
group = LTTextGroupLRTB([obj1, obj2])
plane.remove(obj1)
plane.remove(obj2)
# this line is optimized -- don't change without profiling
dists = [n for n in dists if n[2] in plane._objs and n[3] in plane._objs]
dists = [ n for n in dists if (n[2] in plane and n[3] in plane) ]
for other in plane:
dists.append((0, dist(group, other), group, other))
dists.sort()
dists = csort(dists)
plane.add(group)
assert len(plane) == 1
return list(plane)

View File

@ -269,9 +269,9 @@
<br>Taxable amount (see page 13)
<br></span><span style="font-family: HelveticaNeue-Roman; font-size:10px">
<br></span></div><div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:358px; top:642px; width:10px; height:11px;"><span style="font-family: HelveticaNeue-Bold; font-size:10px">22
<br></span></div><div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:296px; top:644px; width:2px; height:10px;"><span style="font-family: HelveticaNeue-Roman; font-size:10px">
<br></span></div><div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:206px; top:631px; width:2px; height:10px;"><span style="font-family: HelveticaNeue-Roman; font-size:10px">
<br></span></div><div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:184px; top:595px; width:2px; height:10px;"><span style="font-family: HelveticaNeue-Roman; font-size:10px">
<br></span></div><div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:206px; top:631px; width:2px; height:10px;"><span style="font-family: HelveticaNeue-Roman; font-size:10px">
<br></span></div><div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:296px; top:644px; width:2px; height:10px;"><span style="font-family: HelveticaNeue-Roman; font-size:10px">
<br></span></div><div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:308px; top:691px; width:2px; height:10px;"><span style="font-family: HelveticaNeue-Roman; font-size:10px">
<br></span></div><div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:241px; top:703px; width:2px; height:10px;"><span style="font-family: HelveticaNeue-Roman; font-size:10px">
<br></span></div><div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:150px; top:474px; width:2px; height:10px;"><span style="font-family: HelveticaNeue-Roman; font-size:10px">

View File

@ -4983,16 +4983,16 @@
</text>
</textline>
</textbox>
<textbox id="91" bbox="184.848,236.096,187.350,246.590">
<textline bbox="184.848,236.096,187.350,246.590">
<text font="HelveticaNeue-Roman" bbox="184.848,236.096,187.350,246.590" size="10.494"> </text>
<textbox id="91" bbox="206.988,199.946,209.490,210.440">
<textline bbox="206.988,199.946,209.490,210.440">
<text font="HelveticaNeue-Roman" bbox="206.988,199.946,209.490,210.440" size="10.494"> </text>
<text>
</text>
</textline>
</textbox>
<textbox id="92" bbox="206.988,199.946,209.490,210.440">
<textline bbox="206.988,199.946,209.490,210.440">
<text font="HelveticaNeue-Roman" bbox="206.988,199.946,209.490,210.440" size="10.494"> </text>
<textbox id="92" bbox="184.848,236.096,187.350,246.590">
<textline bbox="184.848,236.096,187.350,246.590">
<text font="HelveticaNeue-Roman" bbox="184.848,236.096,187.350,246.590" size="10.494"> </text>
<text>
</text>
</textline>
@ -5967,9 +5967,9 @@
<textbox id="90" bbox="296.198,186.896,298.700,197.390" />
</textgroup>
</textgroup>
<textbox id="91" bbox="184.848,236.096,187.350,246.590" />
<textbox id="91" bbox="206.988,199.946,209.490,210.440" />
</textgroup>
<textbox id="92" bbox="206.988,199.946,209.490,210.440" />
<textbox id="92" bbox="184.848,236.096,187.350,246.590" />
</textgroup>
</textgroup>
<textbox id="93" bbox="308.058,139.676,310.560,150.170" />