From a80ba25896a52dc7a2bd7d2e5365ecf60c0bab36 Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Tue, 4 Feb 2020 15:13:57 -0600 Subject: [PATCH] Draft: disable the excessive output in the ToDo class --- src/Mod/Draft/draftutils/todo.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Mod/Draft/draftutils/todo.py b/src/Mod/Draft/draftutils/todo.py index 2481f2cf68..b5afd97369 100644 --- a/src/Mod/Draft/draftutils/todo.py +++ b/src/Mod/Draft/draftutils/todo.py @@ -43,6 +43,8 @@ __title__ = "FreeCAD Draft Workbench, Todo class" __author__ = "Yorik van Havre " __url__ = ["http://www.freecadweb.org"] +_DEBUG = 0 + class ToDo: """A static class that delays execution of functions. @@ -100,6 +102,7 @@ class ToDo: a string to identify the operation, and a `command_list` which is a list of strings, each string an individual Python instruction. """ + itinerary = [] commitlist = [] afteritinerary = [] @@ -110,12 +113,13 @@ class ToDo: The lists are `itinerary`, `commitlist` and `afteritinerary`. """ - print("Debug: doing delayed tasks.\n" - "itinerary: {0}\n" - "commitlist: {1}\n" - "afteritinerary: {2}\n".format(todo.itinerary, - todo.commitlist, - todo.afteritinerary)) + if _DEBUG: + print("Debug: doing delayed tasks.\n" + "itinerary: {0}\n" + "commitlist: {1}\n" + "afteritinerary: {2}\n".format(todo.itinerary, + todo.commitlist, + todo.afteritinerary)) try: for f, arg in todo.itinerary: try: