def blockIndentation(block):
            text = block.text()
            return text[:len(text) - len(text.lstrip())]
def lock_temp(self, key):
    self.lock(key)
    try:
      yield
    finally:
      self.unlock(key)