Explorar o código

Merge pull request #326 from vmarkovtsev/master

Limit the file name length
Vadim Markovtsev %!s(int64=5) %!d(string=hai) anos
pai
achega
e88ffeeb44
Modificáronse 3 ficheiros con 7 adicións e 2 borrados
  1. 1 1
      .travis.yml
  2. 5 0
      python/labours/plotting.py
  3. 1 1
      python/setup.py

+ 1 - 1
.travis.yml

@@ -1,4 +1,4 @@
-dist: xenial
+dist: bionic
 sudo: required
 
 git:

+ 5 - 0
python/labours/plotting.py

@@ -1,4 +1,5 @@
 import os
+from pathlib import Path
 
 
 def import_pyplot(backend, style):
@@ -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:

+ 1 - 1
python/setup.py

@@ -22,7 +22,7 @@ setup(
     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",