Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files
fix(flow): add warning to jpg downloader
  • Loading branch information
hanhxiao committed Oct 12, 2019
1 parent e3ab1aa commit 7d2c681ec42d1026b8a37c0a26e744e5ae8a7863
Showing with 4 additions and 2 deletions.
  1. +4 −2 gnes/flow/
@@ -238,7 +238,7 @@ def to_url(self, **kwargs) -> str:
return '' % encoded_str

def to_jpg(self, path: str = 'flow.jpg', **kwargs):
def to_jpg(self, path: str = 'flow.jpg', **kwargs) -> None:
Rendering the current flow as a jpg image, this will call :py:meth:`to_mermaid` and it needs internet connection
@@ -249,7 +249,9 @@ def to_jpg(self, path: str = 'flow.jpg', **kwargs):

from urllib.request import Request, urlopen
encoded_str = self.to_url().replace('', '')'saving jpg...')
self.logger.warning('jpg exporting relies on, but it is not very stable. '
'some syntax are not supported, please use with caution.')'downloading as jpg...')
req = Request('' % encoded_str, headers={'User-Agent': 'Mozilla/5.0'})
with open(path, 'wb') as fp:

0 comments on commit 7d2c681

Please sign in to comment.