old_contents: #!/usr/bin/env python3
  
  # Copyright (C) 2015 SINTEF ICT,
  # Applied Mathematics, Norway.
  #
  # Contact information:
  # E-mail: eivind.fonn@sintef.no
  # SINTEF ICT, Department of Applied Mathematics,
  # P.O. Box 4760 Sluppen,
  # 7045 Trondheim, Norway.
  #
  # This file is part of BADGER.
  #
  # BADGER is free software: you can redistribute it and/or modify
  # it under the terms of the GNU Affero General Public License as
  # published by the Free Software Foundation, either version 3 of the
  # License, or (at your option) any later version.
  #
  # BADGER is distributed in the hope that it will be useful,
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  # GNU Affero General Public License for more details.
  #
  # You should have received a copy of the GNU Affero General Public
  # License along with GoTools. If not, see
  # <http://www.gnu.org/licenses/>.
  #
  # In accordance with Section 7(b) of the GNU Affero General Public
  # License, a covered work must retain the producer line in every data
  # file that is created or manipulated using GoTools.
  #
  # Other Usage
  # You can be released from the requirements of the license by purchasing
  # a commercial license. Buying such a license is mandatory as soon as you
  # develop commercial activities involving BADGER without disclosing the
  # source code of your own applications.
  #
  # This file may be used in accordance with the terms contained in a
  # written agreement between you and SINTEF ICT.
  
  from badger import badger, input, output
  
  if __name__ == '__main__':
      args = input.parse_args()
      setup = input.load_setup(args.file)
      final = badger.work(args, setup)
  
      if final:
          getattr(output, args.format)(final, setup['types'], args.output)
  
new_contents: #!/usr/bin/env python3
  
  # Copyright (C) 2015 SINTEF ICT,
  # Applied Mathematics, Norway.
  #
  # Contact information:
  # E-mail: eivind.fonn@sintef.no
  # SINTEF ICT, Department of Applied Mathematics,
  # P.O. Box 4760 Sluppen,
  # 7045 Trondheim, Norway.
  #
  # This file is part of BADGER.
  #
  # BADGER is free software: you can redistribute it and/or modify
  # it under the terms of the GNU Affero General Public License as
  # published by the Free Software Foundation, either version 3 of the
  # License, or (at your option) any later version.
  #
  # BADGER is distributed in the hope that it will be useful,
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  # GNU Affero General Public License for more details.
  #
  # You should have received a copy of the GNU Affero General Public
  # License along with GoTools. If not, see
  # <http://www.gnu.org/licenses/>.
  #
  # In accordance with Section 7(b) of the GNU Affero General Public
  # License, a covered work must retain the producer line in every data
  # file that is created or manipulated using GoTools.
  #
  # Other Usage
  # You can be released from the requirements of the license by purchasing
  # a commercial license. Buying such a license is mandatory as soon as you
  # develop commercial activities involving BADGER without disclosing the
  # source code of your own applications.
  #
  # This file may be used in accordance with the terms contained in a
  # written agreement between you and SINTEF ICT.
  
  from badger import badger, input, output
  from os.path import dirname
  from os import makedirs
  
  if __name__ == '__main__':
      args = input.parse_args()
      setup = input.load_setup(args.file)
  
      badger.ensure_path_exists(args.output)
      final = badger.work(args, setup)
  
      if final:
          getattr(output, args.format)(final, setup['types'], args.output)
  
subject: Allow output in nonexistent folders