async def runInternal(): try: res = await cr except Exception as e: try: f.continueFailed(e) except Exception as e1: log(str(e1)) return f.continueRun(res)
def register(self, prefix='*', convertToStr=True, collect=True, **kargs): if (convertToStr): self.gearsCtx.map(lambda x: str(x)) if (collect): self.gearsCtx.collect() kargs['prefix'] = prefix # this is for backword comptability if 'regex' in kargs: log('Using regex argument with register is depricated and missleading, use prefix instead.', level='warning') kargs['prefix'] = kargs['regex'] self.gearsCtx.register(**kargs)
def method(*argc, **nargs): log('%s is deprecated, use %s instead' % (str(deprecatedName), str(name)), level='warning') return target(*argc, **nargs)
def BeforeFn(*args, **kargs): try: with GearsSession(self.gearsSession): fn(*args, **kargs) except Exception as e: log(e)
def WriteBehindLog(msg, prefix='%s - ' % NAME, logLevel='notice'): msg = prefix + msg log(msg, level=logLevel)