Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_gridline_properties(self, options):
# Convert user gridline properties to structure required internally.
# Set the visible property for the gridline.
gridline = {'visible': options.get('visible')}
# Set the line properties for the gridline.
gridline['line'] = Shape._get_line_properties(options.get('line'))
return gridline
self.date_1904,
self.remove_timezone)
# Set the font properties if present.
axis['num_font'] = self._convert_font_args(options.get('num_font'))
axis['name_font'] = self._convert_font_args(options.get('name_font'))
# Set the axis name layout.
axis['name_layout'] = \
self._get_layout_properties(options.get('name_layout'), True)
# Set the line properties for the axis.
axis['line'] = Shape._get_line_properties(options.get('line'))
# Set the fill properties for the axis.
axis['fill'] = Shape._get_fill_properties(options.get('fill'))
# Set the pattern fill properties for the series.
axis['pattern'] = Shape._get_pattern_properties(options.get('pattern'))
# Set the gradient fill properties for the series.
axis['gradient'] = \
Shape._get_gradient_properties(options.get('gradient'))
# Pattern fill overrides solid fill.
if axis.get('pattern'):
axis['fill'] = None
# Gradient fill overrides the solid and pattern fill.
if axis.get('gradient'):
axis['pattern'] = None
axis['fill'] = None
# Set the axis name layout.
axis['name_layout'] = \
self._get_layout_properties(options.get('name_layout'), True)
# Set the line properties for the axis.
axis['line'] = Shape._get_line_properties(options.get('line'))
# Set the fill properties for the axis.
axis['fill'] = Shape._get_fill_properties(options.get('fill'))
# Set the pattern fill properties for the series.
axis['pattern'] = Shape._get_pattern_properties(options.get('pattern'))
# Set the gradient fill properties for the series.
axis['gradient'] = \
Shape._get_gradient_properties(options.get('gradient'))
# Pattern fill overrides solid fill.
if axis.get('pattern'):
axis['fill'] = None
# Gradient fill overrides the solid and pattern fill.
if axis.get('gradient'):
axis['pattern'] = None
axis['fill'] = None
# Set the tick marker types.
axis['minor_tick_mark'] = \
self._get_tick_type(options.get('minor_tick_mark'))
axis['major_tick_mark'] = \
self._get_tick_type(options.get('major_tick_mark'))
# Set the font properties if present.
axis['num_font'] = self._convert_font_args(options.get('num_font'))
axis['name_font'] = self._convert_font_args(options.get('name_font'))
# Set the axis name layout.
axis['name_layout'] = \
self._get_layout_properties(options.get('name_layout'), True)
# Set the line properties for the axis.
axis['line'] = Shape._get_line_properties(options.get('line'))
# Set the fill properties for the axis.
axis['fill'] = Shape._get_fill_properties(options.get('fill'))
# Set the pattern fill properties for the series.
axis['pattern'] = Shape._get_pattern_properties(options.get('pattern'))
# Set the gradient fill properties for the series.
axis['gradient'] = \
Shape._get_gradient_properties(options.get('gradient'))
# Pattern fill overrides solid fill.
if axis.get('pattern'):
axis['fill'] = None
# Gradient fill overrides the solid and pattern fill.
if axis.get('gradient'):
axis['pattern'] = None
axis['fill'] = None
# Set the tick marker types.
axis['minor_tick_mark'] = \
def __init__(self, shape_type, name, options):
"""
Constructor.
"""
super(Shape, self).__init__()
self.name = name
self.shape_type = shape_type
self.connect = 0
self.drawing = 0
self.edit_as = ''
self.id = 0
self.text = ''
self.textlink = ''
self.stencil = 1
self.element = -1
self.start = None
self.start_index = None
self.end = None
self.end_index = None
self.adjustments = []
self.start_side = ''