Skip to content

Commit

Permalink
Merge pull request #326 from vmarkovtsev/master
Browse files Browse the repository at this point in the history
Limit the file name length
  • Loading branch information
vmarkovtsev committed Nov 21, 2019
2 parents 5263b0a + 68491f6 commit e88ffee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist: xenial
dist: bionic
sudo: required

git:
Expand Down
5 changes: 5 additions & 0 deletions python/labours/plotting.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from pathlib import Path


def import_pyplot(backend, style):
Expand Down Expand Up @@ -57,6 +58,10 @@ def deploy_plot(title: str, output: str, background: str, tight: bool = True) ->
pyplot.gcf().canvas.set_window_title(title)
pyplot.show()
else:
po = Path(output)
if len(po.name) > 64:
suffix = po.suffix[:5]
output = str(po.with_name(po.stem[:64 - len(suffix)] + suffix))
if title:
pyplot.title(title, color="black" if background == "white" else "white")
if tight:
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
description="Python companion for github.com/src-d/hercules to visualize the results.",
long_description=long_description,
long_description_content_type="text/markdown",
version="10.5.2",
version="10.5.3",
license="Apache-2.0",
author="source{d}",
author_email="machine-learning@sourced.tech",
Expand Down

0 comments on commit e88ffee

Please sign in to comment.