We worked around this by installing the patched version of `plantuml`:
!pip3 install --upgrade git+https://github.com/jean/python-plantuml.git#egg=plantuml
Here's the %%uml script for colab that catches and displays the error:
from IPython.core.magic import (Magics, magics_class, cell_magic)
from IPython.core.magics.display import DisplayMagics
from IPython.display import display, Image
from plantuml import PlantUML, PlantUMLHTTPError
# On utilise une classe magics au cas où on veut garder l'état plus tard
@magics_class
class UMLMagics(DisplayMagics):
urlPlantUML = 'http://www.plantuml.com/plantuml/img/'
def __init__(self, shell):
super(UMLMagics, self).__init__(shell=shell)
self.server = PlantUML(url=UMLMagics.urlPlantUML)
@cell_magic
def uml(self, line='', cell=None):
try:
img = Image(self.server.processes(cell))
display(img)
except PlantUMLHTTPError as e:
img = Image(e.content)
display(img)
try:
ip = get_ipython()
magics = UMLMagics(ip)
ip.register_magics(magics)
except NameError:
print("iPython non disponible.")
pass