diff --git a/pycoast/cw_base.py b/pycoast/cw_base.py index ac12d77..a289f7a 100644 --- a/pycoast/cw_base.py +++ b/pycoast/cw_base.py @@ -850,9 +850,9 @@ def add_overlay_from_dict(self, overlays, area_def, cache_epoch=None, background font = truetype(font, font_size) fill = overlays['grid'].get('fill', None) minor_outline = overlays['grid'].get('minor_outline', 'white') - minor_is_tick = overlays['grid'].get('minor_is_tick', - 'true').lower() in \ - ['true', 'yes', '1'] + minor_is_tick = overlays['grid'].get('minor_is_tick', True) + if isinstance(minor_is_tick, str): + minor_is_tick = minor_is_tick.lower() in ['true', 'yes', '1'] lon_placement = overlays['grid'].get('lon_placement', 'tb') lat_placement = overlays['grid'].get('lat_placement', 'lr') diff --git a/pycoast/tests/test_pycoast.py b/pycoast/tests/test_pycoast.py index 98ea288..093100d 100644 --- a/pycoast/tests/test_pycoast.py +++ b/pycoast/tests/test_pycoast.py @@ -812,6 +812,13 @@ def test_cache(self): self.assertNotEqual(os.path.getmtime(cache_filename), mtime) self.assertTrue(fft_metric(euro_data, res), 'Writing of contours failed') + + overlays.pop('cache') + overlays['grid'] = {'outline': (255, 255, 255), 'outline_opacity': 175, + 'minor_outline': (200, 200, 200), 'minor_outline_opacity': 127, + 'width': 1.0, 'minor_width': 0.5, 'minor_is_tick': True, + 'write_text': True, 'lat_placement': 'lr', 'lon_placement': 'b'} + img = cw.add_overlay_from_dict(overlays, area_def) os.remove(os.path.join(tmp, 'pycoast_cache_fakearea.png')) def test_get_resolution(self):