(options: dict)
| 93 | |
| 94 | @staticmethod |
| 95 | def _get_line_properties(options: dict) -> dict: |
| 96 | # Convert user line properties to the structure required internally. |
| 97 | if not options.get("line") and not options.get("border"): |
| 98 | return {"defined": False} |
| 99 | |
| 100 | # Copy the user defined properties since they will be modified. |
| 101 | # Depending on the context, the Excel UI property may be called 'line' |
| 102 | # or 'border'. Internally they are the same so we handle both. |
| 103 | if options.get("line"): |
| 104 | line = copy.deepcopy(options["line"]) |
| 105 | else: |
| 106 | line = copy.deepcopy(options["border"]) |
| 107 | |
| 108 | dash_types = { |
| 109 | "solid": "solid", |
| 110 | "round_dot": "sysDot", |
| 111 | "square_dot": "sysDash", |
| 112 | "dash": "dash", |
| 113 | "dash_dot": "dashDot", |
| 114 | "long_dash": "lgDash", |
| 115 | "long_dash_dot": "lgDashDot", |
| 116 | "long_dash_dot_dot": "lgDashDotDot", |
| 117 | "dot": "dot", |
| 118 | "system_dash_dot": "sysDashDot", |
| 119 | "system_dash_dot_dot": "sysDashDotDot", |
| 120 | } |
| 121 | |
| 122 | # Check the dash type. |
| 123 | dash_type = line.get("dash_type") |
| 124 | |
| 125 | if dash_type is not None: |
| 126 | if dash_type in dash_types: |
| 127 | line["dash_type"] = dash_types[dash_type] |
| 128 | else: |
| 129 | warn(f"Unknown dash type '{dash_type}'") |
| 130 | return {} |
| 131 | |
| 132 | if line.get("color"): |
| 133 | line["color"] = Color._from_value(line["color"]) |
| 134 | |
| 135 | line["defined"] = True |
| 136 | |
| 137 | return line |
| 138 | |
| 139 | @staticmethod |
| 140 | def _get_fill_properties(fill): |
no test coverage detected