Simplify list expression and add license

This commit is contained in:
Campbell Barton
2015-07-09 22:15:24 +10:00
parent a75bd5dec4
commit 0c5b35fda4

View File

@ -1,3 +1,23 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import os
@ -37,17 +57,18 @@ def as_string(dirpath, random_order, exit, **kwargs):
cfg, dirpath = generate(dirpath, random_order, **kwargs)
# hint for reader, can be used if files are not found.
cfg_str = []
cfg_str += ["# generated file\n"]
cfg_str += ["\n"]
cfg_str += ["# edit the search path so other systems may find the files below\n"]
cfg_str += ["# based on name only if the absolute paths cant be found\n"]
cfg_str += ["# Use '//' for current blend file path.\n"]
cfg_str += ["\n"]
cfg_str += ["search_path = %r\n" % dirpath]
cfg_str += ["\n"]
cfg_str += ["exit = %r\n" % exit]
cfg_str += ["\n"]
cfg_str = [
"# generated file\n",
"\n",
"# edit the search path so other systems may find the files below\n",
"# based on name only if the absolute paths cant be found\n",
"# Use '//' for current blend file path.\n",
"\n",
"search_path = %r\n" % dirpath,
"\n",
"exit = %r\n" % exit,
"\n",
]
# All these work but use nicest formatting!
if 0: # works but not nice to edit.