docs: def wrap(self, func, delay=0):
          '''
          returns a function which:
           1. start process
           2. call func, save result
           3. stop process
           4. returns result
  
          similar to :keyword:`with` statement
  
          :rtype:
          '''
          def wrapped():
              self.start()
              if delay:
                  self.sleep(delay)
              x = None
              try:
                  x = func()
              except OSError as oserror:
                  log.debug('OSError exception:%s', oserror)
                  self.oserror = oserror
                  raise EasyProcessError(self, 'wrap error!')
              finally:
                  self.stop()
              return x
          return wrapped