示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 def method(*argc, **nargs):
     log('%s is deprecated, use %s instead' %
         (str(deprecatedName), str(name)),
         level='warning')
     return target(*argc, **nargs)
示例#4
0
 def BeforeFn(*args, **kargs):
     try:
         with GearsSession(self.gearsSession):
             fn(*args, **kargs)
     except Exception as e:
         log(e)
示例#5
0
def WriteBehindLog(msg, prefix='%s - ' % NAME, logLevel='notice'):
    msg = prefix + msg
    log(msg, level=logLevel)