def indentBlock(block):
            cursor = cursorAtSpaceEnd(block)
            cursor.insertText(' ' if withSpace else self.text())
def lock_temp(self, key):
    self.lock(key)
    try:
      yield
    finally:
      self.unlock(key)