| 20 | def __call__(self): return self |
| 21 | |
| 22 | def runasyn(self, wb, info, key, para = None, callback = None): |
| 23 | TaskManager.add(self) |
| 24 | for i in para: |
| 25 | if i in key and key[i][0] == 'img': |
| 26 | ips = ImageManager.get(para[i]) |
| 27 | para[i] = ips if ips is None else ips.img |
| 28 | |
| 29 | if i in key and key[i][0] == 'tab': |
| 30 | tps = TableManager.get(para[i]) |
| 31 | para[i] = tps if tps is None else tps.data |
| 32 | |
| 33 | start = time() |
| 34 | xlreport.fill_value(wb, info, para) |
| 35 | wb.save(para['path']) |
| 36 | IPy.set_info('%s: cost %.3fs'%(self.title, time()-start)) |
| 37 | TaskManager.remove(self) |
| 38 | if callback!=None:callback() |
| 39 | |
| 40 | def start(self, para=None, callafter=None): |
| 41 | wb = pyxl.load_workbook(self.cont) |