File: __init__.py

package info (click to toggle)
python-diagrams 0.23.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 29,208 kB
  • sloc: python: 4,963; makefile: 6
file content (20 lines) | stat: -rw-r--r-- 420 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""
Custom provides the possibility of load an image to be presented as a node.
"""

from diagrams import Node


class Custom(Node):
    _provider = "custom"
    _type = "custom"
    _icon_dir = None

    fontcolor = "#ffffff"

    def _load_icon(self):
        return self._icon

    def __init__(self, label, icon_path, *args, **kwargs):
        self._icon = icon_path
        super().__init__(label, *args, **kwargs)