Licensing and black for BIMTester and IfcBlender. See #1082.

This commit is contained in:
Dion Moult
2022-01-19 11:07:43 +11:00
parent 07264dafb1
commit 5b281260f8
44 changed files with 966 additions and 322 deletions
@@ -1,3 +1,21 @@
# BIMTester - OpenBIM Auditing Tool
# Copyright (C) 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of BIMTester.
#
# BIMTester is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# BIMTester 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with BIMTester. If not, see <http://www.gnu.org/licenses/>.
import os
from behave.model import Scenario
@@ -24,19 +42,14 @@ def before_all(context):
Scenario.continue_after_failed_step = continue_after_failed
# context.ifc_path = userdata.get("ifc", "")
context.ifcfile_basename = os.path.basename(
os.path.splitext(userdata["ifc"])[0]
)
context.ifcfile_basename = os.path.basename(os.path.splitext(userdata["ifc"])[0])
context.outpath = os.path.join(this_path, "..")
context.create_log = False
context.create_smartview = False
if context.create_log is True:
# set up log file
context.thelogfile = os.path.join(
context.outpath,
context.ifcfile_basename + ".log"
)
context.thelogfile = os.path.join(context.outpath, context.ifcfile_basename + ".log")
create_logfile(
context.thelogfile,
context.ifcfile_basename,
@@ -61,10 +74,7 @@ def before_feature(context, feature):
# TODO: refactor zoom smart view support into a decoupled module
if context.create_smartview is True:
smartview_name = context.ifcfile_basename + "_" + feature.name
context.smview_file = os.path.join(
context.outpath,
smartview_name + ".bcsv"
)
context.smview_file = os.path.join(context.outpath, smartview_name + ".bcsv")
# print("SmartView file: {}".format(context.smview_file))
create_zoom_set_of_smartviews(
context.smview_file,
@@ -77,14 +87,6 @@ def after_step(context, step):
if step.status == "failed" and context.create_log is True:
append_logfile(context, step)
if (
step.status == "failed"
and context.create_smartview is True
and hasattr(context, "falseguids")
):
if step.status == "failed" and context.create_smartview is True and hasattr(context, "falseguids"):
# print(context.falseguids)
add_smartview(
context.smview_file,
step.name,
context.falseguids
)
add_smartview(context.smview_file, step.name, context.falseguids)