ooodev.format.calc.modify.cell.borders package

Module contents

class ooodev.format.calc.modify.cell.borders.Borders(*, right=None, left=None, top=None, bottom=None, border_side=None, diagonal_down=None, diagonal_up=None, shadow=None, padding=None, style_name=StyleCellKind.DEFAULT, style_family='CellStyles')[source]

Bases: CellStyleBaseMulti

Cell Style Borders.

New in version 0.9.0.

__init__(*, right=None, left=None, top=None, bottom=None, border_side=None, diagonal_down=None, diagonal_up=None, shadow=None, padding=None, style_name=StyleCellKind.DEFAULT, style_family='CellStyles')[source]

Constructor

Parameters:
  • left (Side,, optional) – Specifies the line style at the left edge.

  • right (Side, optional) – Specifies the line style at the right edge.

  • top (Side, optional) – Specifies the line style at the top edge.

  • bottom (Side, optional) – Specifies the line style at the bottom edge.

  • border_side (Side, optional) – Specifies the line style at the top, bottom, left, right edges. If this argument has a value then arguments top, bottom, left, right are ignored

  • diagonal_down (Side, optional) – Specifies the line style from top-left to bottom-right diagonal.

  • diagonal_up (Side, optional) – Specifies the line style from bottom-left to top-right diagonal.

  • shadow (Shadow, optional) – Cell Shadow.

  • padding (BorderPadding, optional) – Cell padding.

  • style_name (StyleCellKind, str, optional) – Specifies the Cell Style that instance applies to. Default is Default Cell Style.

  • style_family (str, optional) – Style family. Default CellStyles.

Return type:

None

classmethod from_style(doc, style_name=StyleCellKind.DEFAULT, style_family='CellStyles')[source]

Gets instance from Document.

Parameters:
  • doc (object) – UNO Document Object.

  • style_name (StyleCellKind, str, optional) – Specifies the Cell Style that instance applies to. Default is Default Cell Style.

  • style_family (str, optional) – Style family. Default CellStyles.

Returns:

Borders instance from style properties.

Return type:

Borders

property prop_inner: InnerBorders

Gets/Sets Inner Borders instance

Return type:

InnerBorders

property prop_style_name: str

Gets/Sets property Style Name

Return type:

str

class ooodev.format.calc.modify.cell.borders.Padding(*, left=None, right=None, top=None, bottom=None, all=None)[source]

Bases: Padding

Border Padding

Any properties starting with prop_ set or get current instance values.

All methods starting with fmt_ can be used to chain together properties.

New in version 0.9.0.

__init__(*, left=None, right=None, top=None, bottom=None, all=None)[source]

Constructor

Parameters:
  • left (float, UnitT, optional) – Left (in mm units) or Class UnitT.

  • right (float, UnitT, optional) – Right (in mm units) or Class UnitT.

  • top (float, UnitT, optional) – Top (in mm units) or Class UnitT.

  • bottom (float, UnitT, optional) – Bottom (in mm units) or Class UnitT.

  • all (float, UnitT, optional) – Left, right, top, bottom (in mm units) or Class UnitT. If argument is present then left, right, top, and bottom arguments are ignored.

Raises:

ValueError – If any argument value is less than zero.

Return type:

None

class ooodev.format.calc.modify.cell.borders.Shadow(*, location=ShadowLocation.BOTTOM_RIGHT, color=8421504, transparent=False, width=1.76)[source]

Bases: Shadow

Border Shadow

Any properties starting with prop_ set or get current instance values.

All methods starting with fmt_ can be used to chain together properties.

New in version 0.9.0.

__init__(*, location=ShadowLocation.BOTTOM_RIGHT, color=8421504, transparent=False, width=1.76)[source]

Constructor

Parameters:
  • location (ShadowLocation, optional) – contains the location of the shadow. Default to ShadowLocation.BOTTOM_RIGHT.

  • color (Color, optional) – contains the color value of the shadow. Defaults to StandardColor.GRAY.

  • transparent (bool, optional) – Shadow transparency. Defaults to False.

  • width (float, UnitT, optional) – contains the size of the shadow (in mm units) or Class UnitT. Defaults to 1.76.

Raises:

ValueError – If color or width are less than zero.

Return type:

None