fname stringlengths 63 176 | rel_fname stringclasses 706
values | line int64 -1 4.5k | name stringlengths 1 81 | kind stringclasses 2
values | category stringclasses 2
values | info stringlengths 0 77.9k ⌀ |
|---|---|---|---|---|---|---|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/inspector.py | pylint/pyreverse/inspector.py | 337 | dirname | ref | function | os.path.dirname(ast.file), black_list
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/inspector.py | pylint/pyreverse/inspector.py | 339 | func_wrapper | ref | function | ast = func_wrapper(astroid_manager.ast_from_file, fpath)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/inspector.py | pylint/pyreverse/inspector.py | 342 | add_module | ref | function | project.add_module(ast)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 198 | Run | def | class | __init__ run |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 205 | insert_default_options | ref | function | insert_default_options()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 206 | load_command_line_configuration | ref | function | args = self.load_command_line_configuration(args)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 215 | check_graphviz_availability | ref | function | check_graphviz_availability()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 217 | run | ref | function | sys.exit(self.run(args))
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 219 | run | def | function | def run(self, args):
"""Checking arguments and run project."""
if not args:
print(self.help())
return 1
with fix_import_path(args):
project = project_from_files(
args,
project_name=self.config.project,
black_list=self.config.ignore_list,
)
linker = Linker(project, tag=_True)
handler = DiadefsHandler(self.config)
diadefs = handler.get_diadefs(project, linker)
writer.DiagramWriter(self.config).write(diadefs)
return 0
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 224 | fix_import_path | ref | function | with fix_import_path(args):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 225 | project_from_files | ref | function | project = project_from_files(
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 230 | Linker | ref | function | linker = Linker(project, tag=True)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 231 | DiadefsHandler | ref | function | handler = DiadefsHandler(self.config)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 232 | get_diadefs | ref | function | diadefs = handler.get_diadefs(project, linker)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 233 | DiagramWriter | ref | function | writer.DiagramWriter(self.config).write(diadefs)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 233 | write | ref | function | writer.DiagramWriter(self.config).write(diadefs)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/main.py | pylint/pyreverse/main.py | 238 | Run | ref | function | Run(sys.argv[1:])
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 12 | MermaidJSPrinter | def | class | _open_graph emit_node emit_edge _close_graph |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 29 | _open_graph | def | function | def _open_graph(self) -> None:
"""Emit the header lines."""
self.emit("classDiagram")
self._inc_indent()
def emit_node(
self,
name: str,
type_: NodeType,
properties: Optional[NodeProperties] = None,
) -> None:
"""Create a new node. Nodes can be classes, packages, participants etc."""
if properties is None:
properties = NodeProperties(label=name)
stereotype = "~~Interface~~" if type_ is NodeType.INTERFACE else ""
nodetype = self.NODES[type_]
body = []
if properties.attrs:
body.extend(properties.attrs)
if properties.methods:
for func in properties.methods:
args = self._get_method_arguments(func)
line = f"{func.name}({', '.join(args)})"
if func.returns:
line += " -> " + get_annotation_label(func.returns)
body.append(line)
name = name.split(".")[-1]
self.emit(f"{nodetype} {name}{stereotype} {{")
self._inc_indent()
for line in body:
self.emit(line)
self._dec_indent()
self.emit("}")
def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
from_node = from_node.split(".")[-1]
to_node = to_node.split(".")[-1]
edge = f"{from_node} {self.ARROWS[type_]} {to_node}"
if label:
edge += f" : {label}"
self.emit(edge)
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
self._dec_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 31 | emit | ref | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 32 | _inc_indent | ref | function | self._inc_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 34 | emit_node | def | function | def emit_node(
self,
name: str,
type_: NodeType,
properties: Optional[NodeProperties] = None,
) -> None:
"""Create a new node. Nodes can be classes, packages, participants etc."""
if properties is None:
properties = NodeProperties(label=name)
stereotype = "~~Interface~~" if type_ is NodeType.INTERFACE else ""
nodetype = self.NODES[type_]
body = []
if properties.attrs:
body.extend(properties.attrs)
if properties.methods:
for func in properties.methods:
args = self._get_method_arguments(func)
line = f"{func.name}({', '.join(args)})"
if func.returns:
line += " -> " + get_annotation_label(func.returns)
body.append(line)
name = name.split(".")[-1]
self.emit(f"{nodetype} {name}{stereotype} {{")
self._inc_indent()
for line in body:
self.emit(line)
self._dec_indent()
self.emit("}")
def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
from_node = from_node.split(".")[-1]
to_node = to_node.split(".")[-1]
edge = f"{from_node} {self.ARROWS[type_]} {to_node}"
if label:
edge += f" : {label}"
self.emit(edge)
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
self._dec_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 42 | NodeProperties | ref | function | properties = NodeProperties(label=name)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 50 | _get_method_arguments | ref | function | args = self._get_method_arguments(func)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 53 | get_annotation_label | ref | function | line += " -> " + get_annotation_label(func.returns)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 56 | emit | ref | function | self.emit(f"{nodetype} {name}{stereotype} {{")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 57 | _inc_indent | ref | function | self._inc_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 59 | emit | ref | function | self.emit(line)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 60 | _dec_indent | ref | function | self._dec_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 61 | emit | ref | function | self.emit("}")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 63 | emit_edge | def | function | def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
from_node = from_node.split(".")[-1]
to_node = to_node.split(".")[-1]
edge = f"{from_node} {self.ARROWS[type_]} {to_node}"
if label:
edge += f" : {label}"
self.emit(edge)
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
self._dec_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 76 | emit | ref | function | self.emit(edge)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 78 | _close_graph | def | function | def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
self._dec_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 80 | _dec_indent | ref | function | self._dec_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 83 | HTMLMermaidJSPrinter | def | class | _open_graph _close_graph |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 98 | _open_graph | def | function | def _open_graph(self) -> None:
"""Emit the header lines."""
self.emit("classDiagram")
self._inc_indent()
def emit_node(
self,
name: str,
type_: NodeType,
properties: Optional[NodeProperties] = None,
) -> None:
"""Create a new node. Nodes can be classes, packages, participants etc."""
if properties is None:
properties = NodeProperties(label=name)
stereotype = "~~Interface~~" if type_ is NodeType.INTERFACE else ""
nodetype = self.NODES[type_]
body = []
if properties.attrs:
body.extend(properties.attrs)
if properties.methods:
for func in properties.methods:
args = self._get_method_arguments(func)
line = f"{func.name}({', '.join(args)})"
if func.returns:
line += " -> " + get_annotation_label(func.returns)
body.append(line)
name = name.split(".")[-1]
self.emit(f"{nodetype} {name}{stereotype} {{")
self._inc_indent()
for line in body:
self.emit(line)
self._dec_indent()
self.emit("}")
def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
from_node = from_node.split(".")[-1]
to_node = to_node.split(".")[-1]
edge = f"{from_node} {self.ARROWS[type_]} {to_node}"
if label:
edge += f" : {label}"
self.emit(edge)
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
self._dec_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 99 | emit | ref | function | self.emit(self.HTML_OPEN_BOILERPLATE)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 101 | _inc_indent | ref | function | self._inc_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 102 | _open_graph | ref | function | super()._open_graph()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 104 | _close_graph | def | function | def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
self._dec_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 106 | _dec_indent | ref | function | self._dec_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/mermaidjs_printer.py | pylint/pyreverse/mermaidjs_printer.py | 107 | emit | ref | function | self.emit(self.HTML_CLOSE_BOILERPLATE)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 12 | PlantUmlPrinter | def | class | _open_graph emit_node emit_edge _close_graph |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 29 | _open_graph | def | function | def _open_graph(self) -> None:
"""Emit the header lines."""
self.emit("@startuml " + self.title)
if not self.use_automatic_namespace:
self.emit("set namespaceSeparator none")
if self.layout:
if self.layout is Layout.LEFT_TO_RIGHT:
self.emit("left to right direction")
elif self.layout is Layout.TOP_TO_BOTTOM:
self.emit("top to bottom direction")
else:
raise ValueError(
f"Unsupported layout {self.layout}. PlantUmlPrinter only supports left to right and top to bottom layout."
)
def emit_node(
self,
name: str,
type_: NodeType,
properties: Optional[NodeProperties] = None,
) -> None:
"""Create a new node. Nodes can be classes, packages, participants etc."""
if properties is None:
properties = NodeProperties(label=name)
stereotype = " << interface >>" if type_ is NodeType.INTERFACE else ""
nodetype = self.NODES[type_]
if properties.color and properties.color != self.DEFAULT_COLOR:
color = f" #{properties.color}"
else:
color = ""
body = []
if properties.attrs:
body.extend(properties.attrs)
if properties.methods:
for func in properties.methods:
args = self._get_method_arguments(func)
line = f"{func.name}({', '.join(args)})"
if func.returns:
line += " -> " + get_annotation_label(func.returns)
body.append(line)
label = properties.label if properties.label is not None else name
if properties.fontcolor and properties.fontcolor != self.DEFAULT_COLOR:
label = f"<color:{properties.fontcolor}>{label}</color>"
self.emit(f'{nodetype} "{label}" as {name}{stereotype}{color} {{')
self._inc_indent()
for line in body:
self.emit(line)
self._dec_indent()
self.emit("}")
def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
edge = f"{from_node} {self.ARROWS[type_]} {to_node}"
if label:
edge += f" : {label}"
self.emit(edge)
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
self.emit("@enduml")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 31 | emit | ref | function | self.emit("@startuml " + self.title)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 33 | emit | ref | function | self.emit("set namespaceSeparator none")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 36 | emit | ref | function | self.emit("left to right direction")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 38 | emit | ref | function | self.emit("top to bottom direction")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 44 | emit_node | def | function | def emit_node(
self,
name: str,
type_: NodeType,
properties: Optional[NodeProperties] = None,
) -> None:
"""Create a new node. Nodes can be classes, packages, participants etc."""
if properties is None:
properties = NodeProperties(label=name)
stereotype = " << interface >>" if type_ is NodeType.INTERFACE else ""
nodetype = self.NODES[type_]
if properties.color and properties.color != self.DEFAULT_COLOR:
color = f" #{properties.color}"
else:
color = ""
body = []
if properties.attrs:
body.extend(properties.attrs)
if properties.methods:
for func in properties.methods:
args = self._get_method_arguments(func)
line = f"{func.name}({', '.join(args)})"
if func.returns:
line += " -> " + get_annotation_label(func.returns)
body.append(line)
label = properties.label if properties.label is not None else name
if properties.fontcolor and properties.fontcolor != self.DEFAULT_COLOR:
label = f"<color:{properties.fontcolor}>{label}</color>"
self.emit(f'{nodetype} "{label}" as {name}{stereotype}{color} {{')
self._inc_indent()
for line in body:
self.emit(line)
self._dec_indent()
self.emit("}")
def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
edge = f"{from_node} {self.ARROWS[type_]} {to_node}"
if label:
edge += f" : {label}"
self.emit(edge)
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
self.emit("@enduml")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 52 | NodeProperties | ref | function | properties = NodeProperties(label=name)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 64 | _get_method_arguments | ref | function | args = self._get_method_arguments(func)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 67 | get_annotation_label | ref | function | line += " -> " + get_annotation_label(func.returns)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 72 | emit | ref | function | self.emit(f'{nodetype} "{label}" as {name}{stereotype}{color} {{')
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 73 | _inc_indent | ref | function | self._inc_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 75 | emit | ref | function | self.emit(line)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 76 | _dec_indent | ref | function | self._dec_indent()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 77 | emit | ref | function | self.emit("}")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 79 | emit_edge | def | function | def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
edge = f"{from_node} {self.ARROWS[type_]} {to_node}"
if label:
edge += f" : {label}"
self.emit(edge)
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
self.emit("@enduml")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 90 | emit | ref | function | self.emit(edge)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 92 | _close_graph | def | function | def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
self.emit("@enduml")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/plantuml_printer.py | pylint/pyreverse/plantuml_printer.py | 94 | emit | ref | function | self.emit("@enduml")
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 19 | NodeType | def | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 25 | EdgeType | def | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 32 | Layout | def | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 39 | NodeProperties | def | class | |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 47 | Printer | def | class | __init__ _inc_indent _dec_indent _open_graph emit emit_node emit_edge _get_method_arguments generate _close_graph |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 61 | _open_graph | ref | function | self._open_graph()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 63 | _inc_indent | def | function | def _inc_indent(self) -> None:
"""Increment indentation."""
self._indent += " "
def _dec_indent(self) -> None:
"""Decrement indentation."""
self._indent = self._indent[:-2]
@abstractmethod
def _open_graph(self) -> None:
"""Emit the header lines, i.e. all boilerplate code that defines things like layout etc."""
def emit(self, line: str, force_newline: Optional[bool] = _True) -> None:
if force_newline and not line.endswith("\n"):
line += "\n"
self.lines.append(self._indent + line)
@abstractmethod
def emit_node(
self,
name: str,
type_: NodeType,
properties: Optional[NodeProperties] = None,
) -> None:
"""Create a new node. Nodes can be classes, packages, participants etc."""
@abstractmethod
def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
@staticmethod
def _get_method_arguments(method: nodes.FunctionDef) -> List[str]:
if method.args.args:
arguments: List[nodes.AssignName] = [
arg for arg in method.args.args if arg.name != "self"
]
else:
arguments = []
annotations = dict(zip(arguments, method.args.annotations[1:]))
for arg in arguments:
annotation_label = ""
ann = annotations.get(arg)
if ann:
annotation_label = get_annotation_label(ann)
annotations[arg] = annotation_label
return [
f"{arg.name}: {ann}" if ann else f"{arg.name}"
for arg, ann in annotations.items()
]
def generate(self, outputfile: str) -> None:
"""Generate and save the final outputfile."""
self._close_graph()
with open(outputfile, "w", encoding="utf-8") as outfile:
outfile.writelines(self.lines)
@abstractmethod
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 67 | _dec_indent | def | function | def _dec_indent(self) -> None:
"""Decrement indentation."""
self._indent = self._indent[:-2]
@abstractmethod
def _open_graph(self) -> None:
"""Emit the header lines, i.e. all boilerplate code that defines things like layout etc."""
def emit(self, line: str, force_newline: Optional[bool] = _True) -> None:
if force_newline and not line.endswith("\n"):
line += "\n"
self.lines.append(self._indent + line)
@abstractmethod
def emit_node(
self,
name: str,
type_: NodeType,
properties: Optional[NodeProperties] = None,
) -> None:
"""Create a new node. Nodes can be classes, packages, participants etc."""
@abstractmethod
def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
@staticmethod
def _get_method_arguments(method: nodes.FunctionDef) -> List[str]:
if method.args.args:
arguments: List[nodes.AssignName] = [
arg for arg in method.args.args if arg.name != "self"
]
else:
arguments = []
annotations = dict(zip(arguments, method.args.annotations[1:]))
for arg in arguments:
annotation_label = ""
ann = annotations.get(arg)
if ann:
annotation_label = get_annotation_label(ann)
annotations[arg] = annotation_label
return [
f"{arg.name}: {ann}" if ann else f"{arg.name}"
for arg, ann in annotations.items()
]
def generate(self, outputfile: str) -> None:
"""Generate and save the final outputfile."""
self._close_graph()
with open(outputfile, "w", encoding="utf-8") as outfile:
outfile.writelines(self.lines)
@abstractmethod
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 72 | _open_graph | def | function | def _open_graph(self) -> None:
"""Emit the header lines, i.e. all boilerplate code that defines things like layout etc."""
def emit(self, line: str, force_newline: Optional[bool] = _True) -> None:
if force_newline and not line.endswith("\n"):
line += "\n"
self.lines.append(self._indent + line)
@abstractmethod
def emit_node(
self,
name: str,
type_: NodeType,
properties: Optional[NodeProperties] = None,
) -> None:
"""Create a new node. Nodes can be classes, packages, participants etc."""
@abstractmethod
def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
@staticmethod
def _get_method_arguments(method: nodes.FunctionDef) -> List[str]:
if method.args.args:
arguments: List[nodes.AssignName] = [
arg for arg in method.args.args if arg.name != "self"
]
else:
arguments = []
annotations = dict(zip(arguments, method.args.annotations[1:]))
for arg in arguments:
annotation_label = ""
ann = annotations.get(arg)
if ann:
annotation_label = get_annotation_label(ann)
annotations[arg] = annotation_label
return [
f"{arg.name}: {ann}" if ann else f"{arg.name}"
for arg, ann in annotations.items()
]
def generate(self, outputfile: str) -> None:
"""Generate and save the final outputfile."""
self._close_graph()
with open(outputfile, "w", encoding="utf-8") as outfile:
outfile.writelines(self.lines)
@abstractmethod
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 75 | emit | def | function | null |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 81 | emit_node | def | function | def emit_node(
self,
name: str,
type_: NodeType,
properties: Optional[NodeProperties] = None,
) -> None:
"""Create a new node. Nodes can be classes, packages, participants etc."""
@abstractmethod
def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
@staticmethod
def _get_method_arguments(method: nodes.FunctionDef) -> List[str]:
if method.args.args:
arguments: List[nodes.AssignName] = [
arg for arg in method.args.args if arg.name != "self"
]
else:
arguments = []
annotations = dict(zip(arguments, method.args.annotations[1:]))
for arg in arguments:
annotation_label = ""
ann = annotations.get(arg)
if ann:
annotation_label = get_annotation_label(ann)
annotations[arg] = annotation_label
return [
f"{arg.name}: {ann}" if ann else f"{arg.name}"
for arg, ann in annotations.items()
]
def generate(self, outputfile: str) -> None:
"""Generate and save the final outputfile."""
self._close_graph()
with open(outputfile, "w", encoding="utf-8") as outfile:
outfile.writelines(self.lines)
@abstractmethod
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 90 | emit_edge | def | function | def emit_edge(
self,
from_node: str,
to_node: str,
type_: EdgeType,
label: Optional[str] = None,
) -> None:
"""Create an edge from one node to another to display relationships."""
@staticmethod
def _get_method_arguments(method: nodes.FunctionDef) -> List[str]:
if method.args.args:
arguments: List[nodes.AssignName] = [
arg for arg in method.args.args if arg.name != "self"
]
else:
arguments = []
annotations = dict(zip(arguments, method.args.annotations[1:]))
for arg in arguments:
annotation_label = ""
ann = annotations.get(arg)
if ann:
annotation_label = get_annotation_label(ann)
annotations[arg] = annotation_label
return [
f"{arg.name}: {ann}" if ann else f"{arg.name}"
for arg, ann in annotations.items()
]
def generate(self, outputfile: str) -> None:
"""Generate and save the final outputfile."""
self._close_graph()
with open(outputfile, "w", encoding="utf-8") as outfile:
outfile.writelines(self.lines)
@abstractmethod
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 100 | _get_method_arguments | def | function | def _get_method_arguments(method: nodes.FunctionDef) -> List[str]:
if method.args.args:
arguments: List[nodes.AssignName] = [
arg for arg in method.args.args if arg.name != "self"
]
else:
arguments = []
annotations = dict(zip(arguments, method.args.annotations[1:]))
for arg in arguments:
annotation_label = ""
ann = annotations.get(arg)
if ann:
annotation_label = get_annotation_label(ann)
annotations[arg] = annotation_label
return [
f"{arg.name}: {ann}" if ann else f"{arg.name}"
for arg, ann in annotations.items()
]
def generate(self, outputfile: str) -> None:
"""Generate and save the final outputfile."""
self._close_graph()
with open(outputfile, "w", encoding="utf-8") as outfile:
outfile.writelines(self.lines)
@abstractmethod
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 113 | get_annotation_label | ref | function | annotation_label = get_annotation_label(ann)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 121 | generate | def | function | def generate(self, outputfile: str) -> None:
"""Generate and save the final outputfile."""
self._close_graph()
with open(outputfile, "w", encoding="utf-8") as outfile:
outfile.writelines(self.lines)
@abstractmethod
def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 123 | _close_graph | ref | function | self._close_graph()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 125 | writelines | ref | function | outfile.writelines(self.lines)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer.py | pylint/pyreverse/printer.py | 128 | _close_graph | def | function | def _close_graph(self) -> None:
"""Emit the lines needed to properly close the graph."""
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/printer_factory.py | pylint/pyreverse/printer_factory.py | 25 | get_printer_for_filetype | def | function | def get_printer_for_filetype(filetype: str) -> Type[Printer]:
return filetype_to_printer.get(filetype, DotPrinter)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 34 | get_default_options | def | function | def get_default_options():
"""Read config file and return list of options."""
options = []
home = os.environ.get("HOME", "")
if home:
rcfile = os.path.join(home, RCFILE)
try:
with open(rcfile, encoding="utf-8") as file_handle:
options = file_handle.read().split()
except OSError:
pass # ignore if no config file found
return options
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 48 | insert_default_options | def | function | def insert_default_options():
"""Insert default options to sys.argv."""
options = get_default_options()
options.reverse()
for arg in options:
sys.argv.insert(1, arg)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 50 | get_default_options | ref | function | options = get_default_options()
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 62 | get_visibility | def | function | def get_visibility(name):
"""Return the visibility from a name: public, protected, private or special."""
if SPECIAL.match(name):
visibility = "special"
elif PRIVATE.match(name):
visibility = "private"
elif PROTECTED.match(name):
visibility = "protected"
else:
visibility = "public"
return visibility
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 64 | match | ref | function | if SPECIAL.match(name):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 66 | match | ref | function | elif PRIVATE.match(name):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 68 | match | ref | function | elif PROTECTED.match(name):
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 80 | is_abstract | def | function | def is_abstract(node):
"""Return true if the given class node correspond to an abstract class
definition
"""
return ABSTRACT.match(node.name)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 84 | match | ref | function | return ABSTRACT.match(node.name)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 87 | is_final | def | function | def is_final(node):
"""Return true if the given class/function node correspond to final
definition
"""
return FINAL.match(node.name)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 91 | match | ref | function | return FINAL.match(node.name)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 94 | is_interface | def | function | def is_interface(node):
# bw compat
return node.type == "interface"
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 99 | is_exception | def | function | def is_exception(node):
# bw compat
return node.type == "exception"
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 124 | FilterMixIn | def | class | __init__ show_attr |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 137 | show_attr | def | function | def show_attr(self, node):
"""Return true if the node should be treated."""
visibility = get_visibility(getattr(node, "name", node))
return not self.__mode & VIS_MOD[visibility]
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 139 | get_visibility | ref | function | visibility = get_visibility(getattr(node, "name", node))
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 143 | ASTWalker | def | class | __init__ walk get_callbacks visit leave |
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 164 | visit | ref | function | self.visit(node)
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 165 | get_children | ref | function | for child_node in node.get_children():
|
playground/e9b22a58-260b-483f-88d7-7a5fe9f8b1d4/pylint/pylint/pyreverse/utils.py | pylint/pyreverse/utils.py | 168 | leave | ref | function | self.leave(node)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.