MCPcopy Create free account
hub / github.com/PageBot/PageBot / _set_borders

Method _set_borders

Lib/pagebot/elements/element.py:2941–2951  ·  view source on GitHub ↗
(self, borders)

Source from the content-addressed store, hash-verified

2939 """
2940 return self.borderTop, self.borderRight, self.borderBottom, self.borderLeft
2941 def _set_borders(self, borders):
2942 if isUnit(borders) or isinstance(borders, (int, float)):
2943 borders = self.getBorderDict(strokeWidth=borders)
2944 if not isinstance(borders, (list, tuple)):
2945 # Make copy, in case it is a dict, otherwise changes will be made in all.
2946 borders = copy.copy(borders), copy.copy(borders), copy.copy(borders), copy.copy(borders)
2947 elif len(borders) == 2:
2948 borders = [borders[0], borders[0], borders[1], borders[1]]
2949 elif len(borders) == 1:
2950 borders = [borders[0],borders[0],borders[0],borders[0]]
2951 self.borderTop, self.borderRight, self.borderBottom, self.borderLeft = borders
2952 # Seems to be confusing having only one of the two. So allow both property
2953 # names for the same property.
2954 border = borders = property(_get_borders, _set_borders)

Callers

nothing calls this directly

Calls 3

getBorderDictMethod · 0.95
isUnitFunction · 0.90
copyMethod · 0.45

Tested by

no test coverage detected