Method: pylint.pyreverse.vcg_printer.VCGPrinter._write_attributes
Calls: 48, Exceptions: 0, Paths: 3Back
Path 1: 38 calls (0.79)
dict (38)
{'title': 'unittest', 'layoutalgorithm': 'dfs', 'late_edge_labels': 'yes', 'port_sharing': 'no', 'manhattan_edges': 'yes'} (4) {'title': 'packages_No_...
1def _write_attributes(
2 self, attributes_dict: Mapping[str, Any], **args: Any
3 ) -> None:
4 """Write graph, node or edge attributes."""
5 for key, value in args.items():
6 try:
7 _type = attributes_dict[key]
8 except KeyError as e:
9 raise AttributeError(
10 f"no such attribute {key}\npossible attributes are {attributes_dict.keys()}"
11 ) from e
12
13 if not _type:
14 self.emit(f'{key}:"{value}"\n')
15 elif _type == 1:
16 self.emit(f"{key}:{int(value)}\n")
17 elif value in _type:
18 self.emit(f"{key}:{value}\n")
19 else:
20 raise ValueError(
21 f"value {value} isn't correct for attribute {key} correct values are {type}"
22 )
Path 2: 6 calls (0.12)
dict (6)
{'arrowstyle': 'solid', 'backarrowstyle': 'none', 'backarrowsize': 0} (2) {'arrowstyle': 'solid', 'backarrowstyle': 'none', 'backarrowsize': 10} (2) {...
1def _write_attributes(
2 self, attributes_dict: Mapping[str, Any], **args: Any
3 ) -> None:
4 """Write graph, node or edge attributes."""
5 for key, value in args.items():
6 try:
7 _type = attributes_dict[key]
8 except KeyError as e:
9 raise AttributeError(
10 f"no such attribute {key}\npossible attributes are {attributes_dict.keys()}"
11 ) from e
12
13 if not _type:
14 self.emit(f'{key}:"{value}"\n')
15 elif _type == 1:
16 self.emit(f"{key}:{int(value)}\n")
17 elif value in _type:
18 self.emit(f"{key}:{value}\n")
19 else:
20 raise ValueError(
21 f"value {value} isn't correct for attribute {key} correct values are {type}"
22 )
Path 3: 4 calls (0.08)
dict (4)
{'orientation': 'top_to_bottom'} (1) {'orientation': 'bottom_to_top'} (1) {'orientation': 'left_to_right'} (1) {'orientation': 'right_to_left'} (1)
1def _write_attributes(
2 self, attributes_dict: Mapping[str, Any], **args: Any
3 ) -> None:
4 """Write graph, node or edge attributes."""
5 for key, value in args.items():
6 try:
7 _type = attributes_dict[key]
8 except KeyError as e:
9 raise AttributeError(
10 f"no such attribute {key}\npossible attributes are {attributes_dict.keys()}"
11 ) from e
12
13 if not _type:
14 self.emit(f'{key}:"{value}"\n')
15 elif _type == 1:
16 self.emit(f"{key}:{int(value)}\n")
17 elif value in _type:
18 self.emit(f"{key}:{value}\n")
19 else:
20 raise ValueError(
21 f"value {value} isn't correct for attribute {key} correct values are {type}"
22 )