1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Add SVG rendering to cable path tests

This commit is contained in:
jeremystretch
2022-06-27 15:53:34 -04:00
parent 9d35a9d912
commit 8bbc592261
5 changed files with 27 additions and 8 deletions

View File

@@ -5,6 +5,7 @@ from svgwrite.text import Text
from django.conf import settings
from dcim.constants import CABLE_TRACE_SVG_DEFAULT_WIDTH
from utilities.utils import foreground_color
@@ -115,7 +116,7 @@ class CableTraceSVG:
:param width: Width of the generated image (in pixels)
:param base_url: Base URL for links within the SVG document. If none, links will be relative.
"""
def __init__(self, origin, width=400, base_url=None):
def __init__(self, origin, width=CABLE_TRACE_SVG_DEFAULT_WIDTH, base_url=None):
self.origin = origin
self.width = width
self.base_url = base_url.rstrip('/') if base_url is not None else ''