Skip to main content
Sign in
Snippets Groups Projects
Commit bf1ba348 authored by Mayr, Hannes's avatar Mayr, Hannes
Browse files

Fix linting errors.

parent 52aa2ba8
Branches Issue/2221-projectDateCreated
No related tags found
1 merge request!60Enable customization of plotted IDs
Pipeline #888140 failed
File changed. Contains only whitespace changes. Show whitespace changes.
......@@ -44,7 +44,9 @@ def tagplot_image(plotid_object: PlotOptions) -> PlotIDTransfer:
color = tuple(rgb_value * 255 for rgb_value in plotid_object.fontcolor)
# font = ImageFont.load_default()
font_path = files("plotid.resources").joinpath("OpenSans", "OpenSans-Regular.ttf")
font_path = (
files("plotid.resources").joinpath("OpenSans").joinpath("OpenSans-Regular.ttf")
)
font = ImageFont.truetype(str(font_path), plotid_object.fontsize)
if plotid_object.font:
......
......
......@@ -41,8 +41,12 @@ def tagplot_matplotlib(plotid_object: PlotOptions) -> PlotIDTransfer:
matplotlib.font_manager.fontManager.addfont(plotid_object.font)
font = matplotlib.font_manager.FontProperties(fname=plotid_object.font)
else:
font = files("plotid.resources").joinpath("OpenSans", "OpenSans-Regular.ttf")
matplotlib.font_manager.fontManager.addfont(font)
font = (
files("plotid.resources")
.joinpath("OpenSans")
.joinpath("OpenSans-Regular.ttf")
)
matplotlib.font_manager.fontManager.addfont(str(font))
font = matplotlib.font_manager.FontProperties(fname=font)
# Loop to create and position the IDs
......
......
......@@ -5,7 +5,6 @@ Unittests for tagplot_matplotlib
"""
import unittest
from importlib.resources import files
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from plotid.tagplot_matplotlib import tagplot_matplotlib
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment