From ed2630c046b51eb07f0ef8146065d97313e0c9a0 Mon Sep 17 00:00:00 2001 From: Peter Boin Date: Sat, 16 Jun 2018 14:08:17 +1000 Subject: [PATCH] changed __name__ to be more descriptive --- CQGui/Command.py | 2 +- Libs/cadquery/cadquery/cqgi.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CQGui/Command.py b/CQGui/Command.py index fab7bda..df7b793 100644 --- a/CQGui/Command.py +++ b/CQGui/Command.py @@ -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", diff --git a/Libs/cadquery/cadquery/cqgi.py b/Libs/cadquery/cadquery/cqgi.py index 8a4c029..bde5178 100644 --- a/Libs/cadquery/cadquery/cqgi.py +++ b/Libs/cadquery/cadquery/cqgi.py @@ -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) \