Merge pull request #125 from fragmuffin/feature/temp-module-name

changed __name__ to be more descriptive
This commit is contained in:
Jeremy Wright 2018-06-18 21:51:42 -04:00 committed by GitHub
commit 4fc32ec77b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -229,7 +229,7 @@ class CadQueryExecuteScript:
# We import this way because using execfile() causes non-standard script execution in some situations
with revert_sys_modules():
imp.load_source('temp_module', tempFile.name)
imp.load_source('__cq_freecad_module__', tempFile.name)
msg = QtGui.QApplication.translate(
"cqCodeWidget",

View File

@ -101,6 +101,7 @@ class CQModel(object):
self.set_param_values(build_parameters)
collector = ScriptCallback()
env = EnvironmentBuilder().with_real_builtins().with_cadquery_objects() \
.add_entry("__name__", "__cqgi__") \
.add_entry("show_object", collector.show_object) \
.add_entry("debug", collector.debug) \
.add_entry("describe_parameter",collector.describe_parameter) \