File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -718,19 +718,21 @@ def _get_bits(self):
718
718
continue
719
719
else :
720
720
start_inds .append (start_ind )
721
+ # Make sure the indices are in order.
722
+ start_inds = sorted (start_inds )
721
723
# Mark the end of the file.
722
- start_inds .append (0 )
724
+ start_inds .append (None )
723
725
724
726
# Retrieve info for each heading from the printout.
725
727
for i0 , i1 in zip (start_inds [:- 1 ], start_inds [1 :]):
726
728
str_heading_name = bits [i0 ].strip ()
727
- if i1 != 0 :
729
+ if i1 is not None :
728
730
content = bits [i0 + 1 : i1 ]
729
731
else :
730
732
content = bits [i0 + 1 :]
731
733
self .str_headings [str_heading_name ] = content
732
734
733
- def make_content (self ):
735
+ def _make_content (self ):
734
736
elements = []
735
737
for k , v in self .str_headings .items ():
736
738
if v is not None :
@@ -749,7 +751,7 @@ def repr_html(self):
749
751
"""Produce an html representation of a cube and return it."""
750
752
self ._get_bits ()
751
753
summary = self .summary
752
- content = self .make_content ()
754
+ content = self ._make_content ()
753
755
return self ._template .format (summary = summary ,
754
756
content = content ,
755
757
obj_id = self .cube_id ,
Original file line number Diff line number Diff line change @@ -109,12 +109,12 @@ def test_headings__cellmethods(self):
109
109
self .assertIn (str (cell_method ), content_str )
110
110
111
111
112
- class Test_make_content (tests .IrisTest ):
112
+ class Test__make_content (tests .IrisTest ):
113
113
def setUp (self ):
114
114
self .cube = stock .simple_3d ()
115
115
self .representer = _CubeRepresentation (self .cube )
116
116
self .representer ._get_bits ()
117
- self .result = self .representer .make_content ()
117
+ self .result = self .representer ._make_content ()
118
118
119
119
def test_included (self ):
120
120
included = 'Dimension coordinates:'
You can’t perform that action at this time.
0 commit comments