summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Smith <bruce@nanorex.com>2008-03-20 17:01:05 +0000
committerBruce Smith <bruce@nanorex.com>2008-03-20 17:01:05 +0000
commit08c3c51f2e5af584a66048fe8dafa4b2bbc7479f (patch)
tree25193d43f71298f08315a006dbf52d5a005e00be
parent7c37a4d4027982d5a26d1d8efc3dea48d04ffa77 (diff)
downloadnanoengineer-theirix-08c3c51f2e5af584a66048fe8dafa4b2bbc7479f.tar.gz
nanoengineer-theirix-08c3c51f2e5af584a66048fe8dafa4b2bbc7479f.zip
move debug_pref_use_dna_updater to GlobalPreferences.dna_updater_is_enabled
-rw-r--r--cad/src/dna/updater/dna_updater_prefs.py6
-rwxr-xr-xcad/src/model_updater/master_model_updater.py17
-rw-r--r--cad/src/utilities/GlobalPreferences.py25
3 files changed, 29 insertions, 19 deletions
diff --git a/cad/src/dna/updater/dna_updater_prefs.py b/cad/src/dna/updater/dna_updater_prefs.py
index b4c809f1c..551a2c83b 100644
--- a/cad/src/dna/updater/dna_updater_prefs.py
+++ b/cad/src/dna/updater/dna_updater_prefs.py
@@ -17,6 +17,7 @@ from utilities.debug_prefs import Choice
import foundation.env as env
from utilities.Log import orangemsg
+from utilities.GlobalPreferences import dna_updater_is_enabled
from utilities import debug_flags
@@ -169,14 +170,13 @@ def pref_fix_after_readmmp_after_updaters():
# disable when dna updater is off, to work around bug in that case
# (described in checkin mail today)
# (only needed in "after" version) [bruce 080319]
- from model_updater.master_model_updater import debug_pref_use_dna_updater # might be recursive if at toplevel
- if not debug_pref_use_dna_updater():
+ if not dna_updater_is_enabled():
print "bug: the permanent version of this fix is not working, noticed in pref_fix_after_readmmp_after_updaters"
res = debug_pref("DNA: do fix_after_readmmp_after_updaters? ",
Choice_boolean_True, # same comment as for before_updaters version
non_debug = True,
prefs_key = True )
- return res and debug_pref_use_dna_updater() # only ok to do this if dna updater is on
+ return res and dna_updater_is_enabled() # only ok to do this if dna updater is on
# ==
diff --git a/cad/src/model_updater/master_model_updater.py b/cad/src/model_updater/master_model_updater.py
index 00d40516b..6017cb0ec 100755
--- a/cad/src/model_updater/master_model_updater.py
+++ b/cad/src/model_updater/master_model_updater.py
@@ -53,13 +53,14 @@ from model.global_model_changedicts import LAST_RUN_SUCCEEDED
import model.global_model_changedicts as global_model_changedicts # for setting flags in it
import foundation.env as env
+
from utilities.Log import redmsg
+from utilities.GlobalPreferences import dna_updater_is_enabled
+from utilities.debug import print_compact_stack, print_compact_traceback
from model_updater.bond_updater import update_bonds_after_each_event
from model_updater.bond_updater import process_changed_bond_types
-from utilities.debug import print_compact_stack, print_compact_traceback
-
# ==
def _master_model_updater( warn_if_needed = False ):
@@ -128,7 +129,7 @@ def _run_dna_updater(): #bruce 080210 split this out
# TODO: check some dicts first, to optimize this call when not needed?
# TODO: zap the temporary function calls here
#bruce 080319 added sets of status_of_last_dna_updater_run
- if debug_pref_use_dna_updater():
+ if dna_updater_is_enabled():
# never implemented sufficiently: if ...: _reload_dna_updater()
_ensure_ok_to_call_dna_updater() # soon will not be needed here
from dna.updater.dna_updater_main import full_dna_update
@@ -241,14 +242,6 @@ def debug_pref_autodelete_empty_groups():
)
return res
-def debug_pref_use_dna_updater():
- from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False
- res = debug_pref("DNA: enable dna updater?", #bruce 080317 revised text
- Choice_boolean_True, #bruce 080317 False -> True
- non_debug = True,
- prefs_key = "A10/DNA: enable dna updater?" #bruce 080317 changed prefs_key
- )
- return res
_initialized_dna_updater_yet = False
@@ -268,7 +261,7 @@ def initialize():
(in the order in which they should run). These will be
run by env.do_post_event_updates().
"""
- if debug_pref_use_dna_updater():
+ if dna_updater_is_enabled():
## from dna_updater import dna_updater_init
## dna_updater_init.initialize()
_ensure_ok_to_call_dna_updater() # TODO: replace with the commented out 2 lines above
diff --git a/cad/src/utilities/GlobalPreferences.py b/cad/src/utilities/GlobalPreferences.py
index 999822680..9e122829e 100644
--- a/cad/src/utilities/GlobalPreferences.py
+++ b/cad/src/utilities/GlobalPreferences.py
@@ -16,11 +16,17 @@ the kinds of things in it so far -- bruce 080220 comment]
"""
from utilities.prefs_constants import permit_atom_chunk_coselection_prefs_key
-from utilities.debug_prefs import debug_pref, Choice_boolean_False ##, Choice_boolean_True
+from utilities.debug_prefs import debug_pref, Choice_boolean_False, Choice_boolean_True
from utilities.debug import print_compact_traceback
# ==
+DEBUG_BAREMOTION = False #bruce 080129, for bug 2606; should be disabled for commits
+
+DEBUG_BAREMOTION_VERBOSE = False
+
+# ==
+
_pyrex_atoms_failed = False
_pyrex_atoms_succeeded = False
_pyrex_atoms_unwanted_this_session = False
@@ -94,7 +100,9 @@ def debug_pyrex_atoms():
return res
# ==
-# bruce 060721; intended to become constant True for A9
+# bruce 060721; was intended to become constant True for A9; as of 080320 it's not planned for A10
+# but might be good to try to get to afterwards
+
def permit_atom_chunk_coselection():
res = debug_pref("permit atom/chunk coselection?",
## use Choice_boolean_True once this has no obvious bugs
@@ -103,6 +111,8 @@ def permit_atom_chunk_coselection():
prefs_key = permit_atom_chunk_coselection_prefs_key )
return res
+# ==
+
def disable_do_not_draw_open_bonds():
"""
Whether to disable all behavior which under some conditions
@@ -120,8 +130,15 @@ def disable_do_not_draw_open_bonds():
# ==
-DEBUG_BAREMOTION = False #bruce 080129, for bug 2606; should be disabled for commits
+def _debug_pref_use_dna_updater(): #bruce 080320 moved this here from master_model_updater.py, made private
+ res = debug_pref("DNA: enable dna updater?", #bruce 080317 revised text
+ Choice_boolean_True, #bruce 080317 False -> True
+ non_debug = True,
+ prefs_key = "A10/DNA: enable dna updater?" #bruce 080317 changed prefs_key
+ )
+ return res
-DEBUG_BAREMOTION_VERBOSE = False
+def dna_updater_is_enabled(): #bruce 080320
+ return _debug_pref_use_dna_updater()
# end