Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __repr__(self):
items = []
if self.align:
items.append("align={}".format(self.align.align_string))
if self.font_size is not FontSize.NONE:
items.append("font_size={}".format(self.font_size.value))
if self.font_style:
items.append("font_style={}".format(self.font_style.value))
if self.font_weight:
items.append("font_weight={}".format(self.font_weight.value))
if self.thousand_separator is not ThousandSeparator.NONE:
items.append("thousand_separator={}".format(self.thousand_separator.value))
return "({})".format(", ".join(items))
def _font_size_map(self):
return {
FontSize.TINY: r"\tiny",
FontSize.SMALL: r"\small",
FontSize.MEDIUM: r"\normalsize",
FontSize.LARGE: r"\large",
}
def __init__(self, **kwargs):
self.__align = normalize_enum(kwargs.pop("align", Align.AUTO), Align)
self.__validate_attr("align", Align)
self.__font_size = normalize_enum(kwargs.pop("font_size", FontSize.NONE), FontSize)
self.__validate_attr("font_size", FontSize)
self.__font_style = normalize_enum(kwargs.pop("font_style", FontStyle.NORMAL), FontStyle)
self.__validate_attr("font_style", FontStyle)
self.__font_weight = normalize_enum(
kwargs.pop("font_weight", FontWeight.NORMAL), FontWeight
)
self.__validate_attr("font_weight", FontWeight)
self.__thousand_separator = self.__normalie_thousand_separator(
normalize_enum(
kwargs.pop("thousand_separator", ThousandSeparator.NONE), ThousandSeparator
)
)
self.__validate_attr("thousand_separator", ThousandSeparator)
def _font_size_map(self):
return {
FontSize.TINY: r"\tiny",
FontSize.SMALL: r"\small",
FontSize.MEDIUM: r"\normalsize",
FontSize.LARGE: r"\large",
}
def _font_size_map(self):
return {
FontSize.TINY: "font-size:x-small",
FontSize.SMALL: "font-size:small",
FontSize.MEDIUM: "font-size:medium",
FontSize.LARGE: "font-size:large",
}
def _font_size_map(self):
return {
FontSize.TINY: r"\tiny",
FontSize.SMALL: r"\small",
FontSize.MEDIUM: r"\normalsize",
FontSize.LARGE: r"\large",
}
def _font_size_map(self):
return {
FontSize.TINY: "font-size:x-small",
FontSize.SMALL: "font-size:small",
FontSize.MEDIUM: "font-size:medium",
FontSize.LARGE: "font-size:large",
}
def __init__(self, **kwargs):
self.__align = normalize_enum(kwargs.pop("align", Align.AUTO), Align)
self.__validate_attr("align", Align)
self.__font_size = normalize_enum(kwargs.pop("font_size", FontSize.NONE), FontSize)
self.__validate_attr("font_size", FontSize)
self.__font_style = normalize_enum(kwargs.pop("font_style", FontStyle.NORMAL), FontStyle)
self.__validate_attr("font_style", FontStyle)
self.__font_weight = normalize_enum(
kwargs.pop("font_weight", FontWeight.NORMAL), FontWeight
)
self.__validate_attr("font_weight", FontWeight)
self.__thousand_separator = self.__normalie_thousand_separator(
normalize_enum(
kwargs.pop("thousand_separator", ThousandSeparator.NONE), ThousandSeparator
)
)
self.__validate_attr("thousand_separator", ThousandSeparator)
def _font_size_map(self):
return {
FontSize.TINY: r"\tiny",
FontSize.SMALL: r"\small",
FontSize.MEDIUM: r"\normalsize",
FontSize.LARGE: r"\large",
}