text: # © 2021 Nokia
  #
  # Licensed under the BSD 3 Clause license
  # SPDX-License-Identifier: BSD-3-Clause
  
  import os
  
  def makeFolders(path):
      if not os.path.exists(path):
          os.makedirs(path)       
  
  class cd:
      def __init__(self, newPath):
          self.newPath = os.path.expanduser(newPath)
  
      def __enter__(self):
          self.savedPath = os.getcwd()
          os.chdir(self.newPath)
  
      def __exit__(self, etype, value, traceback):
          os.chdir(self.savedPath)
  