diff options
author | BonfaceKilz | 2020-08-26 01:22:36 +0300 |
---|---|---|
committer | BonfaceKilz | 2020-08-26 01:22:36 +0300 |
commit | 900ecc6680efcc00b94f87b234770c03018cc236 (patch) | |
tree | c8fd2e811af2873b9667a7e3756d2ef33960ca11 /wqflask/utility | |
parent | 666a423b0b2f8cf98b9e70ed3dcf1c6dc3896b1d (diff) | |
parent | ba2865102b77536c2b219079fea29dc168467020 (diff) | |
download | genenetwork2-900ecc6680efcc00b94f87b234770c03018cc236.tar.gz |
Merge branch 'testing' into build/python3-migration
Diffstat (limited to 'wqflask/utility')
-rw-r--r-- | wqflask/utility/Plot.py | 10 | ||||
-rw-r--r-- | wqflask/utility/pillow_utils.py | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/wqflask/utility/Plot.py b/wqflask/utility/Plot.py index 4f6e694e..7d9d7649 100644 --- a/wqflask/utility/Plot.py +++ b/wqflask/utility/Plot.py @@ -26,16 +26,12 @@ from __future__ import print_function -from PIL import (Image, ImageColor, ImageDraw, ImageFont) -from pprint import pformat as pf +from PIL import ImageColor +from PIL import ImageDraw +from PIL import ImageFont from math import * -import random -import sys, os -from numarray import linear_algebra as la -from numarray import ones, array, dot, swapaxes -import webqtlUtil import corestats from base import webqtlConfig from utility.pillow_utils import draw_rotated_text diff --git a/wqflask/utility/pillow_utils.py b/wqflask/utility/pillow_utils.py index 1e2ed075..c486abba 100644 --- a/wqflask/utility/pillow_utils.py +++ b/wqflask/utility/pillow_utils.py @@ -1,5 +1,7 @@ from PIL import Image, ImageColor, ImageDraw, ImageFont +from utility.tools import TEMPDIR + import utility.logger logger = utility.logger.getLogger(__name__ ) @@ -14,7 +16,7 @@ def draw_rotated_text(canvas, text, font, xy, fill=BLACK, angle=-90): draw_text = ImageDraw.Draw(tmp_img) draw_text.text(text=text, xy=(0, 0), font=font, fill=fill) tmp_img2 = tmp_img.rotate(angle, expand=1) - tmp_img2.save("/tmp/{}.png".format(text), format="png") + tmp_img2.save("/{0}/{1}.png".format(TEMPDIR, text), format="png") canvas.paste(im=tmp_img2, box=tuple([int(i) for i in xy])) # def draw_open_polygon(canvas: Image, xy: tuple, fill: ImageColor=WHITE, outline: ImageColor=BLACK): |