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

Class Macros

imagepy/core/engine/macros.py:17–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15pub.subscribe(stepmacros, 'stepmacros')
16
17class Macros:
18 def __init__(self, title, cmds):
19 self.title = title
20 self.cmds = cmds
21
22 def _next(self, callafter=None):
23 if self.cur==len(self.cmds):
24 if self.callafter!=None:
25 self.callafter()
26 return
27 if len(self.cmds[self.cur])<3 or self.cmds[self.cur][0] == '#':
28 self.cur += 1
29 return self._next(callafter)
30 title, para = self.cmds[self.cur].split('>')
31 self.cur += 1
32 plg = PluginsManager.get(title)()
33 plg.start(eval(para), self.next)
34
35 def next(self):
36 if IPy.uimode() == 'no':
37 self._next(self)
38 else: wx.CallAfter(pub.sendMessage, 'stepmacros', plg=self)
39
40 def run(self):self.next()
41 #IPy.run_macros(self.cmds)
42
43 def __call__(self):
44 return self
45
46 def start(self, para=None, callafter=None):
47 self.callafter = callafter
48 self.cur = 0
49 self.run()
50
51def show_mc(data, title):
52 wx.CallAfter(Macros(title, data).start)

Callers 9

runFunction · 0.90
runMethod · 0.90
on_runMethod · 0.90
on_runlinesMethod · 0.90
show_mcFunction · 0.70
extend_pluginsFunction · 0.50
extend_toolsFunction · 0.50
fFunction · 0.50
OnDropFilesMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected