MCPcopy Create free account
hub / github.com/Image-Py/imagepy / run

Method run

imagepy/menus/File/open_plg.py:30–40  ·  view source on GitHub ↗
(self, para = None)

Source from the content-addressed store, hash-verified

28 (str, 'url', 'Url:', '')]
29
30 def run(self, para = None):
31 try:
32 fp, fn = os.path.split(para['url'])
33 fn, fe = os.path.splitext(fn)
34 response = urlopen(para['url'])
35 ## TODO: Fixme!
36 stream = StringIO(response.read())
37 img = imread(stream)
38 IPy.show_img([img], fn)
39 except Exception as e:
40 IPy.write('Open url failed!\tErrof:%s'%sys.exc_info()[1])
41
42plgs = [OpenFile, OpenUrl]
43

Callers 1

open_plg.pyFile · 0.45

Calls 3

imreadFunction · 0.50
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected