File: base.py

package info (click to toggle)
python-graphviz 0.20.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,188 kB
  • sloc: python: 4,098; makefile: 13
file content (16 lines) | stat: -rw-r--r-- 465 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Rendering parameter handling."""

from .. import copying

__all__ = ['ParameterBase']


class ParameterBase(copying.CopyBase):
    """Rendering parameter."""

    def _getattr_from_dict(self, attrname: str, *, default=None):
        """Return self.attrname if attrname is in the instance dictionary
            (as oposed to on the type)."""
        if attrname in self.__dict__:
            return getattr(self, attrname)
        return default