|
@@ -18,6 +18,7 @@ from ruamel.yaml import YAML
|
|
|
from PIL import Image
|
|
from PIL import Image
|
|
|
import ast
|
|
import ast
|
|
|
from collections import *
|
|
from collections import *
|
|
|
|
|
+import requests
|
|
|
|
|
|
|
|
from .MatplotlibDraw import MatplotlibDraw
|
|
from .MatplotlibDraw import MatplotlibDraw
|
|
|
drawing_tool = MatplotlibDraw()
|
|
drawing_tool = MatplotlibDraw()
|
|
@@ -68,6 +69,16 @@ class Sketch():
|
|
|
return f"{sketch}/{key}: {name} in {expression} is not defined"
|
|
return f"{sketch}/{key}: {name} in {expression} is not defined"
|
|
|
return 1
|
|
return 1
|
|
|
|
|
|
|
|
|
|
+ def url2Sketch(self, url):
|
|
|
|
|
+ """
|
|
|
|
|
+ get a sketch given an url
|
|
|
|
|
+ """
|
|
|
|
|
+ r = requests.get(url) #, auth=('user', 'pass'))
|
|
|
|
|
+ if r.status_code == 200:
|
|
|
|
|
+ sketchstring = r.text
|
|
|
|
|
+ return self.string2Sketch(sketchstring)
|
|
|
|
|
+ return False
|
|
|
|
|
+
|
|
|
def sketch2File(self, filePath):
|
|
def sketch2File(self, filePath):
|
|
|
"""
|
|
"""
|
|
|
dump a sketch to file
|
|
dump a sketch to file
|