diff options
author | Eric Messick <ericm@nanorex.com> | 2008-03-14 04:44:50 +0000 |
---|---|---|
committer | Eric Messick <ericm@nanorex.com> | 2008-03-14 04:44:50 +0000 |
commit | bcacffeade3f8571f4ba9f7545e0e1afeab8b072 (patch) | |
tree | 6c93c2690a3649102452967e1b3939704a2404fb | |
parent | 1ff69ade95165adbeb0eae702be3731a7b5e70bb (diff) | |
download | nanoengineer-theirix-bcacffeade3f8571f4ba9f7545e0e1afeab8b072.tar.gz nanoengineer-theirix-bcacffeade3f8571f4ba9f7545e0e1afeab8b072.zip |
final planned file move
365 files changed, 1412 insertions, 1415 deletions
diff --git a/cad/src/Makefile b/cad/src/Makefile index 38725b742..23a920d03 100755 --- a/cad/src/Makefile +++ b/cad/src/Makefile @@ -49,7 +49,7 @@ LDSHARED=gcc -shared #---------------------------------------- End of Unix endif SHARED_LIBRARIES = $(SHARED:.lib=.so) -PYREXC=$(shell python -c "import PlatformDependent; print PlatformDependent.find_pyrexc()") +PYREXC=$(shell python -c "import platform.PlatformDependent; print platform.PlatformDependent.find_pyrexc()") CFLAGS+=-fno-strict-aliasing -DNDEBUG -g -Wall -Wmissing-prototypes \ -Wstrict-prototypes -fPIC # These CFLAGS and LDFLAGS are not used by distutils. If asked to diff --git a/cad/src/GroupButtonMixin.py b/cad/src/PM/GroupButtonMixin.py index 021a31348..021a31348 100755 --- a/cad/src/GroupButtonMixin.py +++ b/cad/src/PM/GroupButtonMixin.py diff --git a/cad/src/PM/PM_CheckBox.py b/cad/src/PM/PM_CheckBox.py index ba300f6fe..c67aad0d5 100755 --- a/cad/src/PM/PM_CheckBox.py +++ b/cad/src/PM/PM_CheckBox.py @@ -20,9 +20,9 @@ from PyQt4.Qt import QWidget from PM.PM_Constants import pmLeftColumn, pmRightColumn -from prefs_widgets import widget_connectWithState -from prefs_widgets import QCheckBox_ConnectionWithState -from prefs_widgets import set_metainfo_from_stateref +from widgets.prefs_widgets import widget_connectWithState +from widgets.prefs_widgets import QCheckBox_ConnectionWithState +from widgets.prefs_widgets import set_metainfo_from_stateref class PM_CheckBox( QCheckBox ): """ diff --git a/cad/src/PM/PM_Clipboard.py b/cad/src/PM/PM_Clipboard.py index 4b33a2a80..6ec8ff3d7 100644 --- a/cad/src/PM/PM_Clipboard.py +++ b/cad/src/PM/PM_Clipboard.py @@ -20,7 +20,7 @@ from PyQt4.Qt import QListWidget from PyQt4.Qt import SIGNAL from graphics.widgets.ThumbView import MMKitView from PM.PM_GroupBox import PM_GroupBox -from constants import diTUBES +from utilities.constants import diTUBES class PM_Clipboard(PM_GroupBox): """ diff --git a/cad/src/PM/PM_Colors.py b/cad/src/PM/PM_Colors.py index 1823720ca..735ac9781 100755 --- a/cad/src/PM/PM_Colors.py +++ b/cad/src/PM/PM_Colors.py @@ -19,7 +19,7 @@ import sys from PyQt4.Qt import QColor from PyQt4.Qt import QPalette -from debug_prefs import debug_pref, Choice +from utilities.debug_prefs import debug_pref, Choice _iconPrefix = os.path.dirname(os.path.abspath(sys.argv[0])) diff --git a/cad/src/PM/PM_Dialog.py b/cad/src/PM/PM_Dialog.py index c44567c19..2dd7f5dca 100755 --- a/cad/src/PM/PM_Dialog.py +++ b/cad/src/PM/PM_Dialog.py @@ -13,11 +13,11 @@ file and renamed it PM_Dialog. """ -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from utilities import debug_flags -from icon_utilities import geticon -from icon_utilities import getpixmap +from utilities.icon_utilities import geticon +from utilities.icon_utilities import getpixmap from PyQt4.Qt import Qt @@ -64,7 +64,7 @@ from PyQt4.Qt import QWhatsThis from PM.PM_GroupBox import PM_GroupBox from PM.PM_MessageGroupBox import PM_MessageGroupBox -from Sponsors import SponsorableMixin +from sponsors.Sponsors import SponsorableMixin class PM_Dialog( QDialog, SponsorableMixin ): """ diff --git a/cad/src/PM/PM_DockWidget.py b/cad/src/PM/PM_DockWidget.py index 62ed0344e..00f01b787 100644 --- a/cad/src/PM/PM_DockWidget.py +++ b/cad/src/PM/PM_DockWidget.py @@ -22,7 +22,7 @@ from PM.PM_Colors import getPalette from PM.PM_Colors import pmGrpBoxColor from PM.PM_CheckBox import PM_CheckBox from PM.PM_Constants import pmLeftAlignment, pmRightAlignment -from icon_utilities import getpixmap +from utilities.icon_utilities import getpixmap class PM_DockWidget(QDockWidget): """ diff --git a/cad/src/PM/PM_DoubleSpinBox.py b/cad/src/PM/PM_DoubleSpinBox.py index 16d5ef3cd..cbf9836ac 100755 --- a/cad/src/PM/PM_DoubleSpinBox.py +++ b/cad/src/PM/PM_DoubleSpinBox.py @@ -16,9 +16,9 @@ from PyQt4.Qt import QDoubleSpinBox from PyQt4.Qt import QLabel from PyQt4.Qt import QWidget -from prefs_widgets import widget_connectWithState -from prefs_widgets import QDoubleSpinBox_ConnectionWithState -from prefs_widgets import set_metainfo_from_stateref +from widgets.prefs_widgets import widget_connectWithState +from widgets.prefs_widgets import QDoubleSpinBox_ConnectionWithState +from widgets.prefs_widgets import set_metainfo_from_stateref class PM_DoubleSpinBox( QDoubleSpinBox ): """ diff --git a/cad/src/PM/PM_GroupBox.py b/cad/src/PM/PM_GroupBox.py index 1592c0614..6bbfd6815 100755 --- a/cad/src/PM/PM_GroupBox.py +++ b/cad/src/PM/PM_GroupBox.py @@ -45,7 +45,7 @@ from PyQt4.Qt import QVBoxLayout from PyQt4.Qt import QWidget from PyQt4.Qt import SIGNAL -from icon_utilities import geticon, getpixmap +from utilities.icon_utilities import geticon, getpixmap #This import is only used in isinstance check-- from PM.PM_CheckBox import PM_CheckBox diff --git a/cad/src/PM/PM_ListWidget.py b/cad/src/PM/PM_ListWidget.py index 8c1c2ef44..e7bfeeae7 100755 --- a/cad/src/PM/PM_ListWidget.py +++ b/cad/src/PM/PM_ListWidget.py @@ -16,7 +16,7 @@ from PyQt4.Qt import QLabel from PyQt4.Qt import QListWidget from PyQt4.Qt import QWidget -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback class PM_ListWidget( QListWidget ): """ diff --git a/cad/src/PM/PM_MolecularModelingKit.py b/cad/src/PM/PM_MolecularModelingKit.py index 4c856b0a1..0a6924029 100644 --- a/cad/src/PM/PM_MolecularModelingKit.py +++ b/cad/src/PM/PM_MolecularModelingKit.py @@ -12,8 +12,8 @@ from model.elements import PeriodicTable from PyQt4.Qt import SIGNAL from PM.PM_GroupBox import PM_GroupBox from PM.PM_ToolButtonGrid import PM_ToolButtonGrid -from constants import diTUBES -from debug import print_compact_traceback +from utilities.constants import diTUBES +from utilities.debug import print_compact_traceback from command_support.GeneratorBaseClass import AbstractMethod diff --git a/cad/src/PM/PM_PAM3_AtomChooser.py b/cad/src/PM/PM_PAM3_AtomChooser.py index f4c5ded43..c2d8c97d5 100644 --- a/cad/src/PM/PM_PAM3_AtomChooser.py +++ b/cad/src/PM/PM_PAM3_AtomChooser.py @@ -9,7 +9,7 @@ PM_PAM3_AtomChooser.py """ from PM.PM_MolecularModelingKit import PM_MolecularModelingKit -from constants import diBALL +from utilities.constants import diBALL # Elements button list to create PAM3 atoms toolbutton group. # Format: diff --git a/cad/src/PM/PM_PAM5_AtomChooser.py b/cad/src/PM/PM_PAM5_AtomChooser.py index 8e6610eeb..bce824053 100644 --- a/cad/src/PM/PM_PAM5_AtomChooser.py +++ b/cad/src/PM/PM_PAM5_AtomChooser.py @@ -10,7 +10,7 @@ PM_PAM5_AtomChooser.py from PM.PM_MolecularModelingKit import PM_MolecularModelingKit -from constants import diBALL +from utilities.constants import diBALL # Elements button list to create PAM5 atoms toolbutton group. # Format: diff --git a/cad/src/PM/PM_PartLib.py b/cad/src/PM/PM_PartLib.py index b2bfbd376..de3949534 100644 --- a/cad/src/PM/PM_PartLib.py +++ b/cad/src/PM/PM_PartLib.py @@ -21,7 +21,7 @@ ninad 2007-09-06: Created. import os from utilities import debug_flags -from constants import diTUBES +from utilities.constants import diTUBES from graphics.widgets.ThumbView import MMKitView from model.assembly import assembly from files.mmp.files_mmp import readmmp diff --git a/cad/src/PM/PM_PushButton.py b/cad/src/PM/PM_PushButton.py index 33d71bc83..0d5bcaade 100755 --- a/cad/src/PM/PM_PushButton.py +++ b/cad/src/PM/PM_PushButton.py @@ -16,8 +16,8 @@ from PyQt4.Qt import QLabel from PyQt4.Qt import QPushButton from PyQt4.Qt import QWidget -from prefs_widgets import widget_setAction -from prefs_widgets import QPushButton_ConnectionWithAction +from widgets.prefs_widgets import widget_setAction +from widgets.prefs_widgets import QPushButton_ConnectionWithAction class PM_PushButton( QPushButton ): """ diff --git a/cad/src/PM/PM_SelectionListWidget.py b/cad/src/PM/PM_SelectionListWidget.py index 792540b5f..7b4e645ea 100644 --- a/cad/src/PM/PM_SelectionListWidget.py +++ b/cad/src/PM/PM_SelectionListWidget.py @@ -53,8 +53,8 @@ from PyQt4.Qt import QPalette from PyQt4.Qt import QAbstractItemView ##from PyQt4.Qt import Qt from PM.PM_Colors import getPalette -from constants import yellow -from icon_utilities import geticon +from utilities.constants import yellow +from utilities.icon_utilities import geticon TAG_INSTRUCTIONS = ['TAG_ITEM_IN_GLPANE', 'PICK_ITEM_IN_GLPANE', diff --git a/cad/src/PM/PM_ToolButton.py b/cad/src/PM/PM_ToolButton.py index 34325291e..c4ce5feb7 100755 --- a/cad/src/PM/PM_ToolButton.py +++ b/cad/src/PM/PM_ToolButton.py @@ -18,7 +18,7 @@ from PyQt4.Qt import QToolButton from PyQt4.Qt import QWidget from PyQt4.Qt import QSize -from icon_utilities import geticon +from utilities.icon_utilities import geticon class PM_ToolButton( QToolButton ): """ diff --git a/cad/src/PM/PM_WidgetGrid.py b/cad/src/PM/PM_WidgetGrid.py index 1942b115c..f7496186d 100644 --- a/cad/src/PM/PM_WidgetGrid.py +++ b/cad/src/PM/PM_WidgetGrid.py @@ -19,8 +19,8 @@ from PyQt4.Qt import QLabel from PyQt4.Qt import QToolButton from PyQt4.Qt import QPushButton -from debug import print_compact_traceback -from icon_utilities import geticon +from utilities.debug import print_compact_traceback +from utilities.icon_utilities import geticon from PM.PM_GroupBox import PM_GroupBox diff --git a/cad/src/PropMgr_Constants.py b/cad/src/PM/PropMgr_Constants.py index bbbfb7c86..d3b1a9386 100755 --- a/cad/src/PropMgr_Constants.py +++ b/cad/src/PM/PropMgr_Constants.py @@ -12,7 +12,7 @@ from PyQt4.Qt import Qt from PyQt4.Qt import QColor from PyQt4.Qt import QFont -from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False, Choice +from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False, Choice __author__ = "Mark" diff --git a/cad/src/analysis/ESP/ESPImage.py b/cad/src/analysis/ESP/ESPImage.py index 12166898d..a392810be 100755 --- a/cad/src/analysis/ESP/ESPImage.py +++ b/cad/src/analysis/ESP/ESPImage.py @@ -76,21 +76,21 @@ from graphics.behaviors.shape import SelectionShape from geometry.Slab import Slab from utilities.Log import redmsg, greenmsg -from debug_prefs import debug_pref, Choice_boolean_False +from utilities.debug_prefs import debug_pref, Choice_boolean_False from model.jigs import Jig # REVIEW: all uses of this are suspicious! from graphics.images.ImageUtils import nEImageOps -from constants import black -from constants import ave_colors -from constants import green -from constants import START_NEW_SELECTION -from constants import SUBTRACT_FROM_SELECTION +from utilities.constants import black +from utilities.constants import ave_colors +from utilities.constants import green +from utilities.constants import START_NEW_SELECTION +from utilities.constants import SUBTRACT_FROM_SELECTION from model.jigs_planes import RectGadget from model.jigs_planes import povStrVec from analysis.ESP.ESPImageProp import ESPImageProp -from PlatformDependent import find_or_make_Nanorex_subdir +from platform.PlatformDependent import find_or_make_Nanorex_subdir from analysis.ESP.NanoHiveUtils import get_nh_espimage_filename from analysis.ESP.NanoHiveUtils import run_nh_simulation @@ -400,7 +400,7 @@ class ESPImage(RectGadget): # model space coords. Mark 050930 if 0: from graphics.drawing.drawer import drawline - from constants import yellow + from utilities.constants import yellow drawline(yellow, self.center, self.center + self.planeNorm, 0, 3) def writemmp(self, mapping): diff --git a/cad/src/analysis/ESP/ESPImagePropDialog.py b/cad/src/analysis/ESP/ESPImagePropDialog.py index e8863654d..9e92f2b9f 100755 --- a/cad/src/analysis/ESP/ESPImagePropDialog.py +++ b/cad/src/analysis/ESP/ESPImagePropDialog.py @@ -9,7 +9,7 @@ # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui -from icon_utilities import geticon +from utilities.icon_utilities import geticon class Ui_ESPImagePropDialog(object): def setupUi(self, ESPImagePropDialog): diff --git a/cad/src/analysis/ESP/NanoHive.py b/cad/src/analysis/ESP/NanoHive.py index d1060f1f0..167b60e71 100755 --- a/cad/src/analysis/ESP/NanoHive.py +++ b/cad/src/analysis/ESP/NanoHive.py @@ -17,7 +17,7 @@ from PyQt4.Qt import QString import foundation.env as env -from constants import filesplit +from utilities.constants import filesplit from utilities.Log import redmsg, greenmsg, orangemsg from analysis.ESP.NanoHiveDialog import Ui_NanoHiveDialog diff --git a/cad/src/analysis/ESP/NanoHiveUtils.py b/cad/src/analysis/ESP/NanoHiveUtils.py index c5f036e73..37d9c5842 100755 --- a/cad/src/analysis/ESP/NanoHiveUtils.py +++ b/cad/src/analysis/ESP/NanoHiveUtils.py @@ -18,10 +18,10 @@ Probably "simulation". [bruce 071214] """ import foundation.env as env, os, sys, time -from PlatformDependent import find_or_make_Nanorex_subdir -from prefs_constants import nanohive_path_prefs_key, nanohive_enabled_prefs_key +from platform.PlatformDependent import find_or_make_Nanorex_subdir +from utilities.prefs_constants import nanohive_path_prefs_key, nanohive_enabled_prefs_key from PyQt4.Qt import Qt, QApplication, QCursor -from StatusBar import NanoHiveProgressReporter +from widgets.StatusBar import NanoHiveProgressReporter def get_nh_simspec_filename(basename): """ @@ -280,7 +280,7 @@ def verify_program(program, version_flag, vstring): args = [version_flag] - from Process import Process + from processes.Process import Process arguments = [] for arg in args: @@ -332,7 +332,7 @@ def start_nh(): #print "start_nh(): args=", args - from Process import Process + from processes.Process import Process arguments = [] for arg in args: diff --git a/cad/src/analysis/GAMESS/GamessJob.py b/cad/src/analysis/GAMESS/GamessJob.py index 2640856d3..1d0d8a63b 100755 --- a/cad/src/analysis/GAMESS/GamessJob.py +++ b/cad/src/analysis/GAMESS/GamessJob.py @@ -32,22 +32,22 @@ from PyQt4.Qt import SLOT from PyQt4.Qt import QThread from PyQt4.Qt import QMutex -from SimJob import SimJob +from simulation.SimJob import SimJob from analysis.GAMESS.GamessProp import GamessProp from analysis.GAMESS.files_gms import writegms_inpfile ## from files_gms import writegms_batfile import foundation.preferences as preferences import foundation.env as env # for setting prefs and doing recursive event processing -from icon_utilities import geticon +from utilities.icon_utilities import geticon -from ServerManager import ServerManager +from processes.ServerManager import ServerManager ## from PlatformDependent import open_file_in_editor -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from ne1_ui.UserPrefs import get_filename_and_save_in_prefs -from PlatformDependent import hhmmss_str +from platform.PlatformDependent import hhmmss_str -from prefs_constants import gmspath_prefs_key -from prefs_constants import gamess_enabled_prefs_key +from utilities.prefs_constants import gmspath_prefs_key +from utilities.prefs_constants import gamess_enabled_prefs_key failpat = re.compile("-ABNORMALLY-") irecpat = re.compile(" (\w+) +\d+\.\d* +([\d\.E+-]+) +([\d\.E+-]+) +([\d\.E+-]+)") diff --git a/cad/src/analysis/GAMESS/GamessProp.py b/cad/src/analysis/GAMESS/GamessProp.py index d300ea101..74d9d8ec2 100755 --- a/cad/src/analysis/GAMESS/GamessProp.py +++ b/cad/src/analysis/GAMESS/GamessProp.py @@ -20,12 +20,12 @@ from PyQt4.Qt import QColorDialog import foundation.env as env from analysis.GAMESS.GamessPropDialog import Ui_GamessPropDialog -from ServerManager import ServerManager +from processes.ServerManager import ServerManager from utilities.Log import redmsg ##from files_gms import insertgms -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from widgets.widget_helpers import RGBf_to_QColor, QColor_to_RGBf, get_widget_with_color_palette -from qt4transition import qt4todo +from utilities.qt4transition import qt4todo # Ask Bruce where all this should ultimately live. @@ -589,7 +589,7 @@ class GamessProp(QDialog, Ui_GamessPropDialog): file in an editor. ''' # Make tmp_inputfile filename (i.e. ~/Nanorex/temp/jigname_parms_info.inp) - from PlatformDependent import find_or_make_Nanorex_subdir + from platform.PlatformDependent import find_or_make_Nanorex_subdir tmpdir = find_or_make_Nanorex_subdir('temp') basename = self.gamessJig.name + "-" + self.gamessJig.gms_parms_info('_') tmp_inputfile = os.path.join(tmpdir, "%s.inp" % basename) @@ -598,7 +598,7 @@ class GamessProp(QDialog, Ui_GamessPropDialog): from analysis.GAMESS.files_gms import writegms_inpfile writegms_inpfile(tmp_inputfile, self.gamessJig) - from PlatformDependent import open_file_in_editor + from platform.PlatformDependent import open_file_in_editor open_file_in_editor(tmp_inputfile) def run_job(self): diff --git a/cad/src/analysis/GAMESS/JobManager.py b/cad/src/analysis/GAMESS/JobManager.py index d24f84048..16a21361e 100755 --- a/cad/src/analysis/GAMESS/JobManager.py +++ b/cad/src/analysis/GAMESS/JobManager.py @@ -48,7 +48,7 @@ def touch_job_id_status_file(job_id, Status = 'Queued'): """ # Get the Job Manager directory - from PlatformDependent import find_or_make_Nanorex_subdir + from platform.PlatformDependent import find_or_make_Nanorex_subdir jobdir = find_or_make_Nanorex_subdir('JobManager') # Job Id dir (i.e. ~/Nanorex/JobManager/123/) @@ -95,7 +95,7 @@ def get_job_manager_job_id_and_dir(): # job_id += 1 # Increment the Job Id # Get the Job Manager directory - from PlatformDependent import find_or_make_Nanorex_subdir + from platform.PlatformDependent import find_or_make_Nanorex_subdir jobdir = find_or_make_Nanorex_subdir('JobManager') while 1: @@ -108,7 +108,7 @@ def get_job_manager_job_id_and_dir(): job_id += 1 # It is there, so increment the Job Id and try again. else: - from debug import print_compact_traceback + from utilities.debug import print_compact_traceback try: os.mkdir(job_id_dir) except: @@ -247,7 +247,7 @@ class JobManager(QWidget, Ui_JobManagerDialog): """ Scan Job manager directories to find and return all the list of jobs """ - from PlatformDependent import find_or_make_Nanorex_directory + from platform.PlatformDependent import find_or_make_Nanorex_directory tmpFilePath = find_or_make_Nanorex_directory() managerDir = os.path.join(tmpFilePath, "JobManager") jobDirs = os.listdir(managerDir) diff --git a/cad/src/analysis/GAMESS/files_gms.py b/cad/src/analysis/GAMESS/files_gms.py index e1a03f7a9..1dd78974d 100755 --- a/cad/src/analysis/GAMESS/files_gms.py +++ b/cad/src/analysis/GAMESS/files_gms.py @@ -17,7 +17,7 @@ from model.chunk import Chunk from model.chem import Atom from string import capitalize from model.elements import PeriodicTable -from PlatformDependent import get_gms_name +from platform.PlatformDependent import get_gms_name from utilities.Log import redmsg, orangemsg from geometry.VQT import A import foundation.env as env diff --git a/cad/src/analysis/GAMESS/jig_Gamess.py b/cad/src/analysis/GAMESS/jig_Gamess.py index 17f22d8b8..f3b973b9a 100755 --- a/cad/src/analysis/GAMESS/jig_Gamess.py +++ b/cad/src/analysis/GAMESS/jig_Gamess.py @@ -18,7 +18,7 @@ import foundation.env as env from utilities.Log import redmsg from model.chem import move_alist_and_snuggle import foundation.state_utils as state_utils -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from analysis.GAMESS.GamessJob import GamessJob from analysis.GAMESS.GamessProp import scftyp @@ -47,7 +47,7 @@ from analysis.GAMESS.GamessProp import ui from utilities import debug_flags -from constants import magenta +from utilities.constants import magenta from files.mmp.files_mmp_registration import MMP_RecordParser from files.mmp.files_mmp_registration import register_MMP_RecordParser diff --git a/cad/src/cnt/commands/BuildCnt/BuildCnt_EditCommand.py b/cad/src/cnt/commands/BuildCnt/BuildCnt_EditCommand.py index 968f984db..de9517b43 100644 --- a/cad/src/cnt/commands/BuildCnt/BuildCnt_EditCommand.py +++ b/cad/src/cnt/commands/BuildCnt/BuildCnt_EditCommand.py @@ -26,7 +26,7 @@ from cnt.model.CntGroup import CntGroup from utilities.Log import greenmsg from command_support.GeneratorBaseClass import PluginBug, UserError -from constants import gensym +from utilities.constants import gensym from ne1_ui.toolbars.Ui_CntFlyout import CntFlyout diff --git a/cad/src/cnt/commands/BuildCnt/BuildCnt_PropertyManager.py b/cad/src/cnt/commands/BuildCnt/BuildCnt_PropertyManager.py index 5344b1c3a..d2df30fa1 100644 --- a/cad/src/cnt/commands/BuildCnt/BuildCnt_PropertyManager.py +++ b/cad/src/cnt/commands/BuildCnt/BuildCnt_PropertyManager.py @@ -22,7 +22,7 @@ BUGS: - Just entering and leaving BuildCnt_EditCommand creates an empty CntGroup """ from utilities import debug_flags -from debug import print_compact_stack +from utilities.debug import print_compact_stack from PyQt4.Qt import SIGNAL from PyQt4.Qt import QString @@ -31,7 +31,7 @@ from PM.PM_GroupBox import PM_GroupBox from PM.PM_PushButton import PM_PushButton from PM.PM_SelectionListWidget import PM_SelectionListWidget -from DebugMenuMixin import DebugMenuMixin +from widgets.DebugMenuMixin import DebugMenuMixin from command_support.EditCommand_PM import EditCommand_PM from PM.PM_Constants import pmDoneButton diff --git a/cad/src/cnt/commands/CntSegment/CntSegment_EditCommand.py b/cad/src/cnt/commands/CntSegment/CntSegment_EditCommand.py index 0a1f66ede..945a447f9 100644 --- a/cad/src/cnt/commands/CntSegment/CntSegment_EditCommand.py +++ b/cad/src/cnt/commands/CntSegment/CntSegment_EditCommand.py @@ -46,18 +46,18 @@ from cnt.commands.InsertCnt.Nanotube import Cnt_Atomistic from command_support.GeneratorBaseClass import PluginBug, UserError -from constants import gensym +from utilities.constants import gensym from cnt.model.Cnt_Constants import getCntLength -from test_connectWithState import State_preMixin +from prototype.test_connectWithState import State_preMixin -from constants import noop +from utilities.constants import noop from exprs.attr_decl_macros import Instance, State from exprs.__Symbols__ import _self from exprs.Exprs import call_Expr from exprs.Exprs import norm_Expr -from prefs_widgets import ObjAttr_StateRef +from widgets.prefs_widgets import ObjAttr_StateRef from exprs.ExprsConstants import Width, Point from model.chunk import Chunk diff --git a/cad/src/cnt/commands/CntSegment/CntSegment_GraphicsMode.py b/cad/src/cnt/commands/CntSegment/CntSegment_GraphicsMode.py index 7ada4feed..7ff338ca0 100644 --- a/cad/src/cnt/commands/CntSegment/CntSegment_GraphicsMode.py +++ b/cad/src/cnt/commands/CntSegment/CntSegment_GraphicsMode.py @@ -39,7 +39,7 @@ from cnt.commands.BuildCnt.BuildCnt_GraphicsMode import BuildCnt_GraphicsMode from cnt.model.CntSegment import CntSegment from cnt.temporary_commands.CntLineMode import CntLine_GM -from TemporaryCommand import ESC_to_exit_GraphicsMode_preMixin +from temporary_commands.TemporaryCommand import ESC_to_exit_GraphicsMode_preMixin from graphics.drawing.drawCntLadder import drawCntLadder @@ -47,8 +47,8 @@ import foundation.env as env import math from geometry.VQT import V, norm, A, Q, vlen -from constants import darkred, blue, black -from debug import print_compact_traceback +from utilities.constants import darkred, blue, black +from utilities.debug import print_compact_traceback from commands.Select.Select_GraphicsMode import DRAG_STICKINESS_LIMIT diff --git a/cad/src/cnt/commands/CntSegment/CntSegment_PropertyManager.py b/cad/src/cnt/commands/CntSegment/CntSegment_PropertyManager.py index dfe6b68ee..d56692e64 100644 --- a/cad/src/cnt/commands/CntSegment/CntSegment_PropertyManager.py +++ b/cad/src/cnt/commands/CntSegment/CntSegment_PropertyManager.py @@ -10,7 +10,7 @@ See CntSegment_EditCommand for details. from PyQt4.Qt import SIGNAL from PM.PM_GroupBox import PM_GroupBox -from DebugMenuMixin import DebugMenuMixin +from widgets.DebugMenuMixin import DebugMenuMixin from command_support.EditCommand_PM import EditCommand_PM from PM.PM_Constants import pmDoneButton diff --git a/cad/src/cnt/commands/CntSegment/CntSegment_ResizeHandle.py b/cad/src/cnt/commands/CntSegment/CntSegment_ResizeHandle.py index d29b4a1e0..936665c33 100644 --- a/cad/src/cnt/commands/CntSegment/CntSegment_ResizeHandle.py +++ b/cad/src/cnt/commands/CntSegment/CntSegment_ResizeHandle.py @@ -24,8 +24,8 @@ from exprs.Rect import Sphere from exprs.Arrow import Arrow -from constants import yellow, darkgreen -from constants import olive +from utilities.constants import yellow, darkgreen +from utilities.constants import olive from geometry.VQT import V from exprs.DraggableHandle import DraggableHandle_AlongLine diff --git a/cad/src/cnt/commands/InsertCnt/InsertCnt_EditCommand.py b/cad/src/cnt/commands/InsertCnt/InsertCnt_EditCommand.py index cb694df3c..6fa314bfa 100644 --- a/cad/src/cnt/commands/InsertCnt/InsertCnt_EditCommand.py +++ b/cad/src/cnt/commands/InsertCnt/InsertCnt_EditCommand.py @@ -29,7 +29,7 @@ from command_support.EditCommand import EditCommand from cnt.model.CntSegment import CntSegment from cnt.model.CntGroup import CntGroup -from debug import print_compact_stack +from utilities.debug import print_compact_stack from utilities.Log import redmsg, greenmsg from geometry.VQT import V, Veq, vlen @@ -39,7 +39,7 @@ from cnt.commands.InsertCnt.Nanotube import Cnt_Atomistic from command_support.GeneratorBaseClass import PluginBug, UserError from cnt.commands.InsertCnt.InsertCnt_PropertyManager import InsertCnt_PropertyManager -from constants import gensym +from utilities.constants import gensym from cnt.model.Cnt_Constants import getNumberOfCellsFromCntLength from cnt.model.Cnt_Constants import getCntLength diff --git a/cad/src/cnt/commands/InsertCnt/InsertCnt_PropertyManager.py b/cad/src/cnt/commands/InsertCnt/InsertCnt_PropertyManager.py index 6a83f3e00..5d46ff0b0 100644 --- a/cad/src/cnt/commands/InsertCnt/InsertCnt_PropertyManager.py +++ b/cad/src/cnt/commands/InsertCnt/InsertCnt_PropertyManager.py @@ -31,7 +31,7 @@ from PM.PM_ToolButton import PM_ToolButton from PM.PM_CoordinateSpinBoxes import PM_CoordinateSpinBoxes from PM.PM_CheckBox import PM_CheckBox -from DebugMenuMixin import DebugMenuMixin +from widgets.DebugMenuMixin import DebugMenuMixin from command_support.EditCommand_PM import EditCommand_PM from geometry.VQT import V diff --git a/cad/src/cnt/commands/InsertCnt/Nanotube.py b/cad/src/cnt/commands/InsertCnt/Nanotube.py index 8a49dd138..6e185ab1f 100644 --- a/cad/src/cnt/commands/InsertCnt/Nanotube.py +++ b/cad/src/cnt/commands/InsertCnt/Nanotube.py @@ -17,15 +17,15 @@ import os from math import sin, cos, pi -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from PlatformDependent import find_plugin_dir +from platform.PlatformDependent import find_plugin_dir from files.mmp.files_mmp import readmmp from geometry.VQT import Q, V, angleBetween, cross, vlen from commands.Fuse.fusechunksMode import fusechunksBase from utilities.Log import orangemsg from command_support.GeneratorBaseClass import PluginBug -from prefs_constants import dnaDefaultSegmentColor_prefs_key +from utilities.prefs_constants import dnaDefaultSegmentColor_prefs_key basepath_ok, basepath = find_plugin_dir("Nanotube") if not basepath_ok: diff --git a/cad/src/cnt/model/CntGroup.py b/cad/src/cnt/model/CntGroup.py index 4ac8e3ba8..72771933a 100644 --- a/cad/src/cnt/model/CntGroup.py +++ b/cad/src/cnt/model/CntGroup.py @@ -10,9 +10,9 @@ CntGroup.py - ... from dna.model.Block import Block from model.chunk import Chunk -from constants import gensym +from utilities.constants import gensym -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap from cnt.updater.cnt_updater_globals import _f_CntGroup_for_homeless_objects_in_Part diff --git a/cad/src/cnt/model/CntLadderRailChunk.py b/cad/src/cnt/model/CntLadderRailChunk.py index 193cc1ce7..a3b3bb8de 100644 --- a/cad/src/cnt/model/CntLadderRailChunk.py +++ b/cad/src/cnt/model/CntLadderRailChunk.py @@ -9,10 +9,10 @@ CntLadderRailChunk.py - from model.chunk import Chunk -from constants import gensym -from constants import black -from constants import ave_colors -from constants import diDEFAULT +from utilities.constants import gensym +from utilities.constants import black +from utilities.constants import ave_colors +from utilities.constants import diDEFAULT from utilities import debug_flags diff --git a/cad/src/cnt/model/CntSegment.py b/cad/src/cnt/model/CntSegment.py index d49ae8c9a..e23b074e3 100644 --- a/cad/src/cnt/model/CntSegment.py +++ b/cad/src/cnt/model/CntSegment.py @@ -10,7 +10,7 @@ import foundation.env as env from cnt.model.CntStrandOrSegment import CntStrandOrSegment from cnt.model.CntLadderRailChunk import CntAxisChunk -from debug import print_compact_stack, print_compact_traceback +from utilities.debug import print_compact_stack, print_compact_traceback from model.chunk import Chunk from model.chem import Atom from model.bonds import Bond diff --git a/cad/src/cnt/temporary_commands/CntLineMode.py b/cad/src/cnt/temporary_commands/CntLineMode.py index 8e8249716..ec4dc65ba 100644 --- a/cad/src/cnt/temporary_commands/CntLineMode.py +++ b/cad/src/cnt/temporary_commands/CntLineMode.py @@ -9,11 +9,11 @@ TODO: - User Preferences for different rubberband line display styles """ -from LineMode import LineMode +from temporary_commands.LineMode import LineMode from graphics.drawing.drawCntLadder import drawCntLadder -from constants import gray, black, darkred, blue, white +from utilities.constants import gray, black, darkred, blue, white # == GraphicsMode part diff --git a/cad/src/cnt/updater/cnt_updater_globals.py b/cad/src/cnt/updater/cnt_updater_globals.py index 6b433837a..636cd934d 100644 --- a/cad/src/cnt/updater/cnt_updater_globals.py +++ b/cad/src/cnt/updater/cnt_updater_globals.py @@ -15,7 +15,7 @@ from foundation.changedicts import _cdproc_for_dictid # but it's private! from model.chem import _changed_structure_Atoms, _changed_parent_Atoms # but they're private! refactor sometime -from debug import print_compact_stack +from utilities.debug import print_compact_stack _DEBUG_ATOM_KEY = None # None, or a value of atom.key for which all ignored changes should be printed diff --git a/cad/src/commandSequencer/CommandSequencer.py b/cad/src/commandSequencer/CommandSequencer.py index 879ec2635..aeee2f49c 100644 --- a/cad/src/commandSequencer/CommandSequencer.py +++ b/cad/src/commandSequencer/CommandSequencer.py @@ -28,7 +28,7 @@ in basicMode is really part of the command sequencer (which basicMode should jus interface to rather than "try to be"). """ -from debug import print_compact_traceback, print_compact_stack +from utilities.debug import print_compact_traceback, print_compact_stack from utilities import debug_flags import foundation.env as env import os @@ -660,7 +660,7 @@ class modeMixin(object): res = [] try: # special case for cad/src/exprs/testmode.py (or .pyc) - from constants import CAD_SRC_PATH + from utilities.constants import CAD_SRC_PATH ## CAD_SRC_PATH = os.path.dirname(__file__) for filename in ('testmode.py', 'testmode.pyc'): testmodefile = os.path.join( CAD_SRC_PATH, "exprs", filename) @@ -679,7 +679,7 @@ class modeMixin(object): print "fyi: error adding testmode.py from cad/src/exprs to custom modes menu (ignored)" pass try: - import gpl_only + import platform.gpl_only as gpl_only except ImportError: pass else: @@ -722,7 +722,7 @@ class modeMixin(object): # we'll load it from there instead. That's basically a bug, # but prepending dir onto path would risk much worse bugs # if dir masked any standard modules which got loaded now. - import gpl_only # make sure exec is ok in this version (caller should have done this already) + import platform.gpl_only as gpl_only # make sure exec is ok in this version (caller should have done this already) _module = _modeclass = None # fool pylint into realizing this is not undefined 2 lines below exec("import %s as _module" % (base,)) reload(_module) diff --git a/cad/src/commandSequencer/builtin_command_loaders.py b/cad/src/commandSequencer/builtin_command_loaders.py index 63c4d4274..885f35faf 100644 --- a/cad/src/commandSequencer/builtin_command_loaders.py +++ b/cad/src/commandSequencer/builtin_command_loaders.py @@ -35,11 +35,11 @@ from commands.Extrude.extrudeMode import extrudeMode from commands.Paste.PasteMode import PasteMode from commands.PartLibrary.PartLibraryMode import PartLibraryMode from commands.PlayMovie.movieMode import movieMode -from ZoomToAreaMode import ZoomToAreaMode -from ZoomInOutMode import ZoomInOutMode -from PanMode import PanMode -from RotateMode import RotateMode -from LineMode import LineMode +from temporary_commands.ZoomToAreaMode import ZoomToAreaMode +from temporary_commands.ZoomInOutMode import ZoomInOutMode +from temporary_commands.PanMode import PanMode +from temporary_commands.RotateMode import RotateMode +from temporary_commands.LineMode import LineMode from dna.temporary_commands.DnaLineMode import DnaLineMode from dna.commands.BuildDuplex.DnaDuplex_EditCommand import DnaDuplex_EditCommand from commands.PlaneProperties.Plane_EditCommand import Plane_EditCommand diff --git a/cad/src/commandToolbar/CommandToolbar.py b/cad/src/commandToolbar/CommandToolbar.py index d1383c5ad..3e231be09 100755 --- a/cad/src/commandToolbar/CommandToolbar.py +++ b/cad/src/commandToolbar/CommandToolbar.py @@ -82,7 +82,7 @@ from PyQt4.Qt import SIGNAL from PyQt4.Qt import QToolButton from ne1_ui.toolbars.Ui_CommandToolbar import Ui_CommandToolbar -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback class CommandToolbar(Ui_CommandToolbar): """ diff --git a/cad/src/command_support/Command.py b/cad/src/command_support/Command.py index cc7a8d7b9..d0ecc08b1 100755 --- a/cad/src/command_support/Command.py +++ b/cad/src/command_support/Command.py @@ -27,19 +27,19 @@ basicCommand._exitMode and CommandSequencer.start_using_mode need cleanup. from PyQt4.Qt import QToolButton -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from 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 import debug_flags -from PlatformDependent import shift_name -from PlatformDependent import control_name -from PlatformDependent import context_menu_prefix +from platform.PlatformDependent import shift_name +from platform.PlatformDependent import control_name +from platform.PlatformDependent import context_menu_prefix import foundation.env as env from foundation.state_utils import StateMixin -from constants import noop, GLPANE_IS_COMMAND_SEQUENCER +from utilities.constants import noop, GLPANE_IS_COMMAND_SEQUENCER from model.jigs import Jig # this is used only for cmenu making diff --git a/cad/src/command_support/EditCommand.py b/cad/src/command_support/EditCommand.py index c68f341ae..64c2d0d6a 100644 --- a/cad/src/command_support/EditCommand.py +++ b/cad/src/command_support/EditCommand.py @@ -36,7 +36,7 @@ TODO: import foundation.changes as changes from utilities.Comparison import same_vals -from constants import permit_gensym_to_reuse_name +from utilities.constants import permit_gensym_to_reuse_name from command_support.GeneratorBaseClass import AbstractMethod from commands.Select.Select_Command import Select_Command diff --git a/cad/src/command_support/EditCommand_PM.py b/cad/src/command_support/EditCommand_PM.py index a5416528c..0db43e92b 100644 --- a/cad/src/command_support/EditCommand_PM.py +++ b/cad/src/command_support/EditCommand_PM.py @@ -18,7 +18,7 @@ from PyQt4.Qt import QWidgetAction from PyQt4.Qt import SIGNAL
from command_support.GeneratorBaseClass import AbstractMethod
-from icon_utilities import geticon
+from utilities.icon_utilities import geticon
class EditCommand_PM(PM_Dialog):
"""
diff --git a/cad/src/command_support/GeneratorBaseClass.py b/cad/src/command_support/GeneratorBaseClass.py index 714a4ebd4..3a267a6c0 100755 --- a/cad/src/command_support/GeneratorBaseClass.py +++ b/cad/src/command_support/GeneratorBaseClass.py @@ -64,9 +64,9 @@ from utilities import debug_flags from utilities.Log import redmsg, orangemsg, greenmsg, quote_html from utilities.Comparison import same_vals -from debug import print_compact_traceback -from constants import gensym -from constants import permit_gensym_to_reuse_name +from utilities.debug import print_compact_traceback +from utilities.constants import gensym +from utilities.constants import permit_gensym_to_reuse_name # == private definitions diff --git a/cad/src/command_support/GraphicsMode.py b/cad/src/command_support/GraphicsMode.py index d0a992e60..7767c1bf6 100755 --- a/cad/src/command_support/GraphicsMode.py +++ b/cad/src/command_support/GraphicsMode.py @@ -31,20 +31,20 @@ from PyQt4.Qt import QMenu from geometry.VQT import V, Q, vlen, norm, planeXline, ptonline, cross import graphics.drawing.drawer as drawer -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from utilities import debug_flags import foundation.env as env from graphics.behaviors.shape import get_selCurve_color -from constants import SELSHAPE_RECT -from constants import yellow +from utilities.constants import SELSHAPE_RECT +from utilities.constants import yellow -from prefs_constants import zoomAboutScreenCenter_prefs_key -from prefs_constants import displayOriginAxis_prefs_key -from prefs_constants import displayOriginAsSmallAxis_prefs_key -from prefs_constants import displayPOVAxis_prefs_key +from utilities.prefs_constants import zoomAboutScreenCenter_prefs_key +from utilities.prefs_constants import displayOriginAxis_prefs_key +from utilities.prefs_constants import displayOriginAsSmallAxis_prefs_key +from utilities.prefs_constants import displayPOVAxis_prefs_key from model.chem import Atom from model.bonds import Bond @@ -237,7 +237,7 @@ class basicGraphicsMode(GraphicsMode_API): [part of GLPane's drawing interface to modes] """ # conf corner is enabled by default for A9.1 (070627); requires exprs module and Python Imaging Library - from debug_prefs import debug_pref, Choice_boolean_True + from utilities.debug_prefs import debug_pref, Choice_boolean_True if not debug_pref("Enable confirmation corner?", Choice_boolean_True, prefs_key = True): return # figure out what kind of confirmation corner we want, and draw it @@ -876,7 +876,7 @@ class basicGraphicsMode(GraphicsMode_API): # (Old behavior was to use the same pref as for zooming in.) #e [Should this be a separate user pref? For now it's a debug pref, just for testing. # We might replace these two prefs with a 3-choice pref which controls them both.] - from debug_prefs import debug_pref, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_False if debug_pref("GLPane: zoom out acts the same as zoom in?", Choice_boolean_False, prefs_key = "A9 devel/GLPane: zoom out same as zoom in?" ): diff --git a/cad/src/command_support/JigProp.py b/cad/src/command_support/JigProp.py index 365d69e24..e3ef5ff3e 100755 --- a/cad/src/command_support/JigProp.py +++ b/cad/src/command_support/JigProp.py @@ -13,7 +13,7 @@ __author__ = "Mark" from PyQt4.Qt import QDialog from PyQt4.Qt import SIGNAL from PyQt4.Qt import QColorDialog -from icon_utilities import geticon +from utilities.icon_utilities import geticon from command_support.JigPropDialog import Ui_JigPropDialog diff --git a/cad/src/command_support/MotorPropertyManager.py b/cad/src/command_support/MotorPropertyManager.py index be65e6737..e53ac606a 100644 --- a/cad/src/command_support/MotorPropertyManager.py +++ b/cad/src/command_support/MotorPropertyManager.py @@ -19,7 +19,7 @@ from command_support.GeneratorBaseClass import AbstractMethod from command_support.EditCommand_PM import EditCommand_PM
-from debug import print_compact_traceback
+from utilities.debug import print_compact_traceback
class MotorPropertyManager(EditCommand_PM):
"""
diff --git a/cad/src/command_support/ParameterDialog.py b/cad/src/command_support/ParameterDialog.py index fba31e4da..4a5c4bec8 100755 --- a/cad/src/command_support/ParameterDialog.py +++ b/cad/src/command_support/ParameterDialog.py @@ -48,18 +48,18 @@ from PyQt4.Qt import SLOT from command_support.generator_button_images import image0_data, image1_data, image2_data, image3_data, image4_data, image5_data, image6_data, image7_data -from widget_controllers import CollapsibleGroupController_Qt, FloatLineeditController_Qt #e might be gotten from env instead... +from widgets.widget_controllers import CollapsibleGroupController_Qt, FloatLineeditController_Qt #e might be gotten from env instead... -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from qt4transition import qt4todo +from utilities.qt4transition import qt4todo import foundation.env as env # for env.debug(); warning: some methods have a local variable which overrides this -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap from tokenize import generate_tokens #bruce 080101 moved to toplevel, untested -from parse_utils import parse_top, Whole #bruce 080101 moved to toplevel, untested +from utilities.parse_utils import parse_top, Whole #bruce 080101 moved to toplevel, untested # image uses -- we should rename them ####@@@@ diff --git a/cad/src/command_support/modes.py b/cad/src/command_support/modes.py index 603c42661..bfdd9698c 100755 --- a/cad/src/command_support/modes.py +++ b/cad/src/command_support/modes.py @@ -53,7 +53,7 @@ even though it can't yet replace the ones it splits out of. since those are all split now.] """ -from constants import GLPANE_IS_COMMAND_SEQUENCER +from utilities.constants import GLPANE_IS_COMMAND_SEQUENCER from command_support.Command import anyCommand, nullCommand, basicCommand diff --git a/cad/src/commands/BuildAtom/AtomGeneratorPropertyManager.py b/cad/src/commands/BuildAtom/AtomGeneratorPropertyManager.py index 8c9c28dc0..218b7b73f 100755 --- a/cad/src/commands/BuildAtom/AtomGeneratorPropertyManager.py +++ b/cad/src/commands/BuildAtom/AtomGeneratorPropertyManager.py @@ -48,7 +48,7 @@ History: """ -from icon_utilities import geticon, getpixmap +from utilities.icon_utilities import geticon, getpixmap from PyQt4.Qt import Qt, SIGNAL diff --git a/cad/src/commands/BuildAtoms/BuildAtoms_Command.py b/cad/src/commands/BuildAtoms/BuildAtoms_Command.py index 1e6bc0ae6..b1035e5f2 100755 --- a/cad/src/commands/BuildAtoms/BuildAtoms_Command.py +++ b/cad/src/commands/BuildAtoms/BuildAtoms_Command.py @@ -40,13 +40,13 @@ from PyQt4.Qt import SIGNAL import foundation.env as env import foundation.changes as changes -from icon_utilities import geticon +from utilities.icon_utilities import geticon -from debug import print_compact_stack -from debug import print_compact_traceback +from utilities.debug import print_compact_stack +from utilities.debug import print_compact_traceback -from prefs_constants import buildModeHighlightingEnabled_prefs_key -from prefs_constants import keepBondsDuringTransmute_prefs_key +from utilities.prefs_constants import buildModeHighlightingEnabled_prefs_key +from utilities.prefs_constants import keepBondsDuringTransmute_prefs_key from commands.BuildAtoms.BuildAtomsPropertyManager import BuildAtomsPropertyManager from commands.SelectAtoms.SelectAtoms_Command import SelectAtoms_basicCommand diff --git a/cad/src/commands/BuildAtoms/BuildAtoms_GraphicsMode.py b/cad/src/commands/BuildAtoms/BuildAtoms_GraphicsMode.py index 8da6ac18c..17a59cbec 100755 --- a/cad/src/commands/BuildAtoms/BuildAtoms_GraphicsMode.py +++ b/cad/src/commands/BuildAtoms/BuildAtoms_GraphicsMode.py @@ -59,7 +59,7 @@ from PyQt4.Qt import Qt import foundation.env as env from utilities import debug_flags -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals from model.chunk import Chunk from model.chem import Atom @@ -77,11 +77,11 @@ from graphics.behaviors.shape import get_selCurve_color from model.bonds import bond_atoms, bond_at_singlets from model.bond_constants import V_SINGLE -from debug import print_compact_stack +from utilities.debug import print_compact_stack -from constants import elemKeyTab -from constants import diINVISIBLE -from constants import diTUBES +from utilities.constants import elemKeyTab +from utilities.constants import diINVISIBLE +from utilities.constants import diTUBES from model.bond_constants import btype_from_v6 from model.bond_constants import V_DOUBLE @@ -89,8 +89,8 @@ from model.bond_constants import V_GRAPHITE from model.bond_constants import V_TRIPLE from model.bond_constants import V_AROMATIC -from prefs_constants import buildModeSelectAtomsOfDepositedObjEnabled_prefs_key -from prefs_constants import buildModeWaterEnabled_prefs_key +from utilities.prefs_constants import buildModeSelectAtomsOfDepositedObjEnabled_prefs_key +from utilities.prefs_constants import buildModeWaterEnabled_prefs_key from utilities.Log import orangemsg, redmsg @@ -269,7 +269,7 @@ class BuildAtoms_basicGraphicsMode(SelectAtoms_basicGraphicsMode): if v6 is not None: self.set_cmdname('Change Bond') btype = btype_from_v6( v6) - from bond_utils import apply_btype_to_bond + from operations.bond_utils import apply_btype_to_bond apply_btype_to_bond( btype, diff --git a/cad/src/commands/BuildAtoms/build_utils.py b/cad/src/commands/BuildAtoms/build_utils.py index dca03f9aa..014ddd397 100755 --- a/cad/src/commands/BuildAtoms/build_utils.py +++ b/cad/src/commands/BuildAtoms/build_utils.py @@ -19,7 +19,7 @@ with new bonding patterns. And did some of that extension, 050511. from geometry.VQT import norm from model.chem import Atom -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback class DepositionTool: "#doc" @@ -154,7 +154,7 @@ class AtomTypeDepositionTool(DepositionTool): msg = " (%d bond(s) made)" % n else: msg = " (%d bond(s) NOT made, since autobond is off)" % (n-1) #bruce 050901 new feature - from PlatformDependent import fix_plurals + from platform.PlatformDependent import fix_plurals msg = fix_plurals(msg) desc += msg return atm, desc diff --git a/cad/src/commands/BuildAtoms/depositMode.py b/cad/src/commands/BuildAtoms/depositMode.py index 02a5c4a95..5205156c8 100755 --- a/cad/src/commands/BuildAtoms/depositMode.py +++ b/cad/src/commands/BuildAtoms/depositMode.py @@ -18,8 +18,8 @@ GraphicsMode parts and the these classes were moved into their own module [ See BuildAtoms_Command.py and BuildAtoms_GraphicsMode.py] """ -from debug import print_compact_traceback -from constants import GLPANE_IS_COMMAND_SEQUENCER +from utilities.debug import print_compact_traceback +from utilities.constants import GLPANE_IS_COMMAND_SEQUENCER from commands.BuildAtoms.BuildAtoms_Command import BuildAtoms_basicCommand from commands.BuildAtoms.BuildAtoms_GraphicsMode import BuildAtoms_basicGraphicsMode diff --git a/cad/src/commands/BuildCrystal/CookieCtrlPanel.py b/cad/src/commands/BuildCrystal/CookieCtrlPanel.py index 8dadf4090..90810a874 100755 --- a/cad/src/commands/BuildCrystal/CookieCtrlPanel.py +++ b/cad/src/commands/BuildCrystal/CookieCtrlPanel.py @@ -21,8 +21,8 @@ from PyQt4.Qt import QColor from PyQt4.Qt import QColorDialog from commands.BuildCrystal.CookiePropertyManager import CookiePropertyManager -from icon_utilities import geticon -from constants import dispLabel +from utilities.icon_utilities import geticon +from utilities.constants import dispLabel class CookieCtrlPanel(CookiePropertyManager): diff --git a/cad/src/commands/BuildCrystal/CookieShape.py b/cad/src/commands/BuildCrystal/CookieShape.py index 6262a8d5c..df29dedc6 100755 --- a/cad/src/commands/BuildCrystal/CookieShape.py +++ b/cad/src/commands/BuildCrystal/CookieShape.py @@ -33,13 +33,13 @@ from graphics.drawing.drawer import drawsphere from graphics.drawing.drawer import drawline from graphics.drawing.drawer import ColorSorter, ColorSortedDisplayList -from constants import SUBTRACT_FROM_SELECTION -from constants import OUTSIDE_SUBTRACT_FROM_SELECTION -from constants import ADD_TO_SELECTION -from constants import START_NEW_SELECTION -from constants import white +from utilities.constants import SUBTRACT_FROM_SELECTION +from utilities.constants import OUTSIDE_SUBTRACT_FROM_SELECTION +from utilities.constants import ADD_TO_SELECTION +from utilities.constants import START_NEW_SELECTION +from utilities.constants import white -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from geometry.BoundingBox import BBox @@ -850,7 +850,7 @@ class CookieShape(shape): """ from model.chunk import Chunk from model.chem import Atom - from constants import gensym + from utilities.constants import gensym numLayers = len(self.bondLayers) if numLayers: diff --git a/cad/src/commands/BuildCrystal/Ui_CookiePropertyManager.py b/cad/src/commands/BuildCrystal/Ui_CookiePropertyManager.py index a5d3e1489..9d43c4a36 100755 --- a/cad/src/commands/BuildCrystal/Ui_CookiePropertyManager.py +++ b/cad/src/commands/BuildCrystal/Ui_CookiePropertyManager.py @@ -33,7 +33,7 @@ from PM.PM_Constants import pmDoneButton from PM.PM_Constants import pmWhatsThisButton from PM.PM_Constants import pmCancelButton -from icon_utilities import geticon +from utilities.icon_utilities import geticon __author__ = "Ninad" diff --git a/cad/src/commands/BuildCrystal/cookieMode.py b/cad/src/commands/BuildCrystal/cookieMode.py index bfdf7c8f6..1b8e6f76d 100755 --- a/cad/src/commands/BuildCrystal/cookieMode.py +++ b/cad/src/commands/BuildCrystal/cookieMode.py @@ -48,14 +48,14 @@ from graphics.drawing.drawer import genDiam from model.chunk import Chunk from model.chem import Atom -from constants import gensym -from constants import diTUBES -from constants import SELSHAPE_LASSO -from constants import START_NEW_SELECTION -from constants import white -from constants import ADD_TO_SELECTION -from constants import SUBTRACT_FROM_SELECTION -from constants import SELSHAPE_RECT +from utilities.constants import gensym +from utilities.constants import diTUBES +from utilities.constants import SELSHAPE_LASSO +from utilities.constants import START_NEW_SELECTION +from utilities.constants import white +from utilities.constants import ADD_TO_SELECTION +from utilities.constants import SUBTRACT_FROM_SELECTION +from utilities.constants import SELSHAPE_RECT import foundation.changes as changes diff --git a/cad/src/commands/CommentProperties/CommentProp.py b/cad/src/commands/CommentProperties/CommentProp.py index 99ca76fda..bf4ad455e 100755 --- a/cad/src/commands/CommentProperties/CommentProp.py +++ b/cad/src/commands/CommentProperties/CommentProp.py @@ -18,8 +18,8 @@ from commands.CommentProperties.CommentPropDialog import Ui_CommentPropDialog import time import foundation.env as env from utilities.Log import redmsg, orangemsg, greenmsg, quote_html -from qt4transition import qt4todo -from debug import print_compact_traceback +from utilities.qt4transition import qt4todo +from utilities.debug import print_compact_traceback cmd = greenmsg("Insert Comment: ") diff --git a/cad/src/commands/ElementColors/elementColors.py b/cad/src/commands/ElementColors/elementColors.py index a649f476a..c020231ef 100755 --- a/cad/src/commands/ElementColors/elementColors.py +++ b/cad/src/commands/ElementColors/elementColors.py @@ -16,9 +16,9 @@ from PyQt4.Qt import QGLFormat from commands.ElementColors.ElementColorsDialog import Ui_ElementColorsDialog from model.elements import PeriodicTable -from constants import diTrueCPK, diBALL, diTUBES +from utilities.constants import diTrueCPK, diBALL, diTUBES from graphics.widgets.ThumbView import ElementView -from qt4transition import qt4todo +from utilities.qt4transition import qt4todo from utilities.Log import redmsg # Mark 050311 from geometry.VQT import V @@ -214,7 +214,7 @@ class elementColors(QDialog, Ui_ElementColorsDialog): if self.w.assy.filename: odir = os.path.dirname(self.w.assy.filename) else: - from prefs_constants import workingDirectory_prefs_key + from utilities.prefs_constants import workingDirectory_prefs_key odir = env.prefs[workingDirectory_prefs_key] self.fileName = str( QFileDialog.getOpenFileName( self, @@ -246,7 +246,7 @@ class elementColors(QDialog, Ui_ElementColorsDialog): currently only r,g,b color of each element will be saved. """ if not self.fileName: - from prefs_constants import workingDirectory_prefs_key + from utilities.prefs_constants import workingDirectory_prefs_key sdir = env.prefs[workingDirectory_prefs_key] else: sdir = self.fileName diff --git a/cad/src/commands/ElementSelector/elementSelector.py b/cad/src/commands/ElementSelector/elementSelector.py index 8246e1b42..1ed97b543 100755 --- a/cad/src/commands/ElementSelector/elementSelector.py +++ b/cad/src/commands/ElementSelector/elementSelector.py @@ -12,7 +12,7 @@ from PyQt4.Qt import QVBoxLayout from commands.ElementSelector.ElementSelectorDialog import Ui_ElementSelectorDialog from graphics.widgets.ThumbView import ElementView from model.elements import PeriodicTable -from constants import diTUBES +from utilities.constants import diTUBES class elementSelector(QDialog, Ui_ElementSelectorDialog): def __init__(self, win): diff --git a/cad/src/commands/Extrude/extrudeMode.py b/cad/src/commands/Extrude/extrudeMode.py index 97069a899..19521a24e 100755 --- a/cad/src/commands/Extrude/extrudeMode.py +++ b/cad/src/commands/Extrude/extrudeMode.py @@ -48,12 +48,12 @@ from PyQt4.Qt import Qt from PyQt4.Qt import SIGNAL from PyQt4.Qt import QCursor -from debug_prefs import debug_pref, Choice, Choice_boolean_False ##, Choice_boolean_True +from utilities.debug_prefs import debug_pref, Choice, Choice_boolean_False ##, Choice_boolean_True from command_support.modes import basicMode -from debug import print_compact_traceback, print_compact_stack +from utilities.debug import print_compact_traceback, print_compact_stack from model.bonds import bond_at_singlets -from icon_utilities import geticon +from utilities.icon_utilities import geticon from utilities.Log import redmsg from geometry.VQT import check_posns_near, check_quats_near @@ -69,8 +69,8 @@ from graphics.behaviors.shape import get_selCurve_color from graphics.drawables.handles import repunitHandleSet from graphics.drawables.handles import niceoffsetsHandleSet from graphics.drawables.handles import draggableHandle_HandleSet -from constants import blue -from constants import green +from utilities.constants import blue +from utilities.constants import green MAX_NCOPIES = 360 # max number of extrude-unit copies. Should this be larger? Motivation is to avoid "hangs from slowness". @@ -1602,7 +1602,7 @@ class extrudeMode(basicMode): Choice_boolean_False, prefs_key = True ): #bruce 070928 if self.product_type == 'closed ring': try: - from constants import red + from utilities.constants import red self.update_ring_geometry(emit_messages = False) # emit_messages = False to fix infinite redraw loop # when it chooses z-y plane and prints a message about that @@ -2107,7 +2107,7 @@ class fake_merged_mol( virtual_group_of_Chunks): #e rename? 'extrude_unit_holder # WARNING: the following code after our call to copy_nodes_in_order is similar to # other code after calls to the related function copied_nodes_for_DND, e.g. in depositMode.py. # A higher-level utility routine which does all this post-processing should be added to ops_copy.py. ###e - from ops_copy import copy_nodes_in_order + from operations.ops_copy import copy_nodes_in_order #bruce 070525 precaution: use this instead of copied_nodes_for_DND, since order # (in fact, precise 1-1 orig-copy correspondence) matters here. oldnodes = self._mols diff --git a/cad/src/commands/Fuse/FuseChunks_Command.py b/cad/src/commands/Fuse/FuseChunks_Command.py index c5d50f64d..d08375225 100755 --- a/cad/src/commands/Fuse/FuseChunks_Command.py +++ b/cad/src/commands/Fuse/FuseChunks_Command.py @@ -24,10 +24,10 @@ from geometry.VQT import vlen from model.elements import Singlet from utilities.Log import redmsg, orangemsg -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals from commands.Fuse.FusePropertyManager import FusePropertyManager -from icon_utilities import geticon -from constants import diINVISIBLE +from utilities.icon_utilities import geticon +from utilities.constants import diINVISIBLE from commands.Move.Move_Command import Move_Command from commands.Fuse.fusechunksMode import fusechunksBase diff --git a/cad/src/commands/Fuse/FuseChunks_GraphicsMode.py b/cad/src/commands/Fuse/FuseChunks_GraphicsMode.py index 5fe2252f7..2a9a51c33 100755 --- a/cad/src/commands/Fuse/FuseChunks_GraphicsMode.py +++ b/cad/src/commands/Fuse/FuseChunks_GraphicsMode.py @@ -15,10 +15,10 @@ Ninad 2008-01-25: Split Command and GraphicsMode classes from graphics.drawing.drawer import drawline from graphics.behaviors.shape import get_selCurve_color -from constants import green -from constants import magenta -from constants import blue -from constants import darkred +from utilities.constants import green +from utilities.constants import magenta +from utilities.constants import blue +from utilities.constants import darkred from commands.Move.Move_GraphicsMode import Move_GraphicsMode from commands.Translate.TranslateChunks_GraphicsMode import TranslateChunks_GraphicsMode diff --git a/cad/src/commands/Fuse/fusechunksMode.py b/cad/src/commands/Fuse/fusechunksMode.py index a0b6fc695..2b3cea8c2 100755 --- a/cad/src/commands/Fuse/fusechunksMode.py +++ b/cad/src/commands/Fuse/fusechunksMode.py @@ -20,16 +20,16 @@ from model.elements import Singlet from commands.Move.modifyMode import modifyMode from model.bonds import bond_at_singlets from utilities.Log import redmsg, orangemsg -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals from commands.Fuse.FusePropertyManager import FusePropertyManager -from icon_utilities import geticon +from utilities.icon_utilities import geticon from graphics.behaviors.shape import get_selCurve_color -from constants import green -from constants import magenta -from constants import blue -from constants import darkred -from constants import diINVISIBLE +from utilities.constants import green +from utilities.constants import magenta +from utilities.constants import blue +from utilities.constants import darkred +from utilities.constants import diINVISIBLE MAKEBONDS = 'Make Bonds Between Chunks' FUSEATOMS = 'Fuse Overlapping Atoms' diff --git a/cad/src/commands/GridPlaneProperties/GridPlaneProp.py b/cad/src/commands/GridPlaneProperties/GridPlaneProp.py index 14809b0a0..0ea340856 100755 --- a/cad/src/commands/GridPlaneProperties/GridPlaneProp.py +++ b/cad/src/commands/GridPlaneProperties/GridPlaneProp.py @@ -62,7 +62,7 @@ class GridPlaneProp(QDialog, Ui_GridPlanePropDialog): def _set_xyspacing_enabled(self, grid_type): '''If <grid_type> == 1, which is SiC type, disable x, y spacing comboBox, otherwise, enable it. ''' - from prefs_constants import SiC_GRID, SQUARE_GRID + from utilities.prefs_constants import SiC_GRID, SQUARE_GRID if grid_type == SiC_GRID: self.x_spacing_spinbox.setEnabled(False) diff --git a/cad/src/commands/InsertGraphene/GrapheneGenerator.py b/cad/src/commands/InsertGraphene/GrapheneGenerator.py index 2633f6877..9a963ccb9 100755 --- a/cad/src/commands/InsertGraphene/GrapheneGenerator.py +++ b/cad/src/commands/InsertGraphene/GrapheneGenerator.py @@ -23,7 +23,7 @@ import model.bond_constants as bond_constants from model.chunk import Chunk import foundation.env as env -from debug import Stopwatch +from utilities.debug import Stopwatch from model.elements import PeriodicTable from utilities.Log import greenmsg diff --git a/cad/src/commands/InsertHeterojunction/CoNTubGenerator.py b/cad/src/commands/InsertHeterojunction/CoNTubGenerator.py index c2a5d6b9f..163877602 100755 --- a/cad/src/commands/InsertHeterojunction/CoNTubGenerator.py +++ b/cad/src/commands/InsertHeterojunction/CoNTubGenerator.py @@ -24,14 +24,14 @@ reload(CoNTubGenerator) import os, sys, time import foundation.env as env -import Initialize +import utilities.Initialize as Initialize from utilities.Log import quote_html, redmsg ##, orangemsg, greenmsg from command_support.ParameterDialog import ParameterDialog, ParameterPane from command_support.GeneratorController import GeneratorController from command_support.GeneratorBaseClass import UserError, PluginBug ##, CadBug -from debug import print_compact_traceback -from PlatformDependent import find_or_make_any_directory, tempfiles_dir, find_plugin_dir -import EndUser +from utilities.debug import print_compact_traceback +from platform.PlatformDependent import find_or_make_any_directory, tempfiles_dir, find_plugin_dir +import utilities.EndUser as EndUser debug_install = False @@ -43,7 +43,7 @@ def debug_run(): ### one current bug: menu icon is nondeterministic. guess: need to keep a reference to the iconset that we make for it. # that seemed to help at first, but it's not enough, bug still happens sometimes when we reload this a lot! ####@@@@ -from debug_prefs import use_property_pane +from utilities.debug_prefs import use_property_pane # == @@ -54,7 +54,7 @@ def add_insert_menu_item(win, command, name_of_what_to_insert, options = ()): ## undo_cmdname = "Insert %s" % (name_of_what_to_insert,) ## get this from caller, or, make it available to the command as it runs ###e but need to translate it ourselves, ##qApp.translate("Main Window", "Recent Files", None) ## self.connect(self.recentFilePopupMenu, SIGNAL('activated (int)'), self._openRecentFile) - from menu_helpers import insert_command_into_menu + from widgets.menu_helpers import insert_command_into_menu insert_command_into_menu( menu, menutext, command, options = options, position = menuIndex, undo_cmdname = undo_cmdname) return @@ -327,7 +327,7 @@ class PluginlikeGenerator: return def imagename_to_pixmap(self, imagename): # KLUGE, see comment where dialog_env is set to self ###@@@ might work but untested ###@@@ - from icon_utilities import imagename_to_pixmap + from utilities.icon_utilities import imagename_to_pixmap path = None for trydir in [self.plugin_dir, os.path.join(self.plugin_dir, "images")]: trypath = os.path.join( trydir, imagename ) diff --git a/cad/src/commands/InsertNanotube/NanotubeGenerator.py b/cad/src/commands/InsertNanotube/NanotubeGenerator.py index e23ce309e..40816a145 100755 --- a/cad/src/commands/InsertNanotube/NanotubeGenerator.py +++ b/cad/src/commands/InsertNanotube/NanotubeGenerator.py @@ -16,7 +16,7 @@ from Numeric import dot from geometry.VQT import vlen, cross, norm, V import foundation.env as env from utilities import debug_flags -from debug import Stopwatch +from utilities.debug import Stopwatch from model.chem import Atom diff --git a/cad/src/commands/InsertNanotube/NanotubeGeneratorPropertyManager.py b/cad/src/commands/InsertNanotube/NanotubeGeneratorPropertyManager.py index 26728ad7c..8844147a0 100755 --- a/cad/src/commands/InsertNanotube/NanotubeGeneratorPropertyManager.py +++ b/cad/src/commands/InsertNanotube/NanotubeGeneratorPropertyManager.py @@ -20,7 +20,7 @@ from PM.PM_DoubleSpinBox import PM_DoubleSpinBox from PM.PM_SpinBox import PM_SpinBox from model.bonds import CC_GRAPHITIC_BONDLENGTH, BN_GRAPHITIC_BONDLENGTH -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback ntBondLengths = [CC_GRAPHITIC_BONDLENGTH, BN_GRAPHITIC_BONDLENGTH] diff --git a/cad/src/commands/InsertPeptide/PeptideGenerator.py b/cad/src/commands/InsertPeptide/PeptideGenerator.py index 339e27a11..e29492340 100755 --- a/cad/src/commands/InsertPeptide/PeptideGenerator.py +++ b/cad/src/commands/InsertPeptide/PeptideGenerator.py @@ -28,7 +28,7 @@ from model.bonds import bond_atoms from model.bonds import NeighborhoodGenerator from model.bond_constants import atoms_are_bonded from model.bond_constants import V_SINGLE, V_DOUBLE, V_AROMATIC -from bonds_from_atoms import inferBonds +from operations.bonds_from_atoms import inferBonds from Numeric import zeros, array, sqrt, pi, sin, cos, dot, Float from geometry.VQT import vlen, cross, norm, V diff --git a/cad/src/commands/InsertPeptide/PeptideGeneratorPropertyManager.py b/cad/src/commands/InsertPeptide/PeptideGeneratorPropertyManager.py index ec48faa6c..59f64394e 100755 --- a/cad/src/commands/InsertPeptide/PeptideGeneratorPropertyManager.py +++ b/cad/src/commands/InsertPeptide/PeptideGeneratorPropertyManager.py @@ -31,7 +31,7 @@ from PM.PM_PushButton import PM_PushButton from PM.PM_ToolButtonGrid import PM_ToolButtonGrid from PM.PM_TextEdit import PM_TextEdit -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from utilities.Log import orangemsg, greenmsg, redmsg import foundation.env as env diff --git a/cad/src/commands/LinearMotorProperties/LinearMotorPropertyManager.py b/cad/src/commands/LinearMotorProperties/LinearMotorPropertyManager.py index cdd6753f4..ad8c1106a 100644 --- a/cad/src/commands/LinearMotorProperties/LinearMotorPropertyManager.py +++ b/cad/src/commands/LinearMotorProperties/LinearMotorPropertyManager.py @@ -21,7 +21,7 @@ from widgets.widget_helpers import RGBf_to_QColor from command_support.MotorPropertyManager import MotorPropertyManager
-from constants import gray
+from utilities.constants import gray
class LinearMotorPropertyManager(MotorPropertyManager):
"""
diff --git a/cad/src/commands/LinearMotorProperties/LinearMotor_EditCommand.py b/cad/src/commands/LinearMotorProperties/LinearMotor_EditCommand.py index 1fc3a3e15..bff4102a2 100644 --- a/cad/src/commands/LinearMotorProperties/LinearMotor_EditCommand.py +++ b/cad/src/commands/LinearMotorProperties/LinearMotor_EditCommand.py @@ -13,7 +13,7 @@ ninad 2007-10-09: Created. import foundation.env as env from utilities.Log import redmsg, greenmsg, orangemsg from model.jigs_motors import LinearMotor -from jigmakers_Mixin import atom_limit_exceeded_and_confirmed +from operations.jigmakers_Mixin import atom_limit_exceeded_and_confirmed from command_support.EditCommand import EditCommand from commands.SelectAtoms.SelectAtoms_GraphicsMode import SelectAtoms_GraphicsMode diff --git a/cad/src/commands/MinimizeEnergy/MinimizeEnergyProp.py b/cad/src/commands/MinimizeEnergy/MinimizeEnergyProp.py index d2d32f9a7..b5c4c1b0c 100755 --- a/cad/src/commands/MinimizeEnergy/MinimizeEnergyProp.py +++ b/cad/src/commands/MinimizeEnergy/MinimizeEnergyProp.py @@ -19,25 +19,25 @@ from PyQt4.Qt import QDoubleValidator from utilities.Log import greenmsg, redmsg, orangemsg, _graymsg, quote_html from commands.MinimizeEnergy.MinimizeEnergyPropDialog import Ui_MinimizeEnergyPropDialog -from GroupButtonMixin import GroupButtonMixin -from Sponsors import SponsorableMixin -from icon_utilities import geticon +from PM.GroupButtonMixin import GroupButtonMixin +from sponsors.Sponsors import SponsorableMixin +from utilities.icon_utilities import geticon -from prefs_constants import Minimize_watchRealtimeMinimization_prefs_key -from prefs_constants import Minimize_endRMS_prefs_key as endRMS_prefs_key -from prefs_constants import Minimize_endMax_prefs_key as endMax_prefs_key -from prefs_constants import Minimize_cutoverRMS_prefs_key as cutoverRMS_prefs_key -from prefs_constants import Minimize_cutoverMax_prefs_key as cutoverMax_prefs_key -from prefs_constants import Minimize_minimizationEngine_prefs_key -from prefs_constants import electrostaticsForDnaDuringMinimize_prefs_key +from utilities.prefs_constants import Minimize_watchRealtimeMinimization_prefs_key +from utilities.prefs_constants import Minimize_endRMS_prefs_key as endRMS_prefs_key +from utilities.prefs_constants import Minimize_endMax_prefs_key as endMax_prefs_key +from utilities.prefs_constants import Minimize_cutoverRMS_prefs_key as cutoverRMS_prefs_key +from utilities.prefs_constants import Minimize_cutoverMax_prefs_key as cutoverMax_prefs_key +from utilities.prefs_constants import Minimize_minimizationEngine_prefs_key +from utilities.prefs_constants import electrostaticsForDnaDuringMinimize_prefs_key -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback import foundation.env as env from utilities import debug_flags from ne1_ui.UserPrefs import get_pref_or_optval from widgets.widget_helpers import double_fixup -from debug_prefs import debug_pref, Choice_boolean_False -from prefs_widgets import connect_checkbox_with_boolean_pref +from utilities.debug_prefs import debug_pref, Choice_boolean_False +from widgets.prefs_widgets import connect_checkbox_with_boolean_pref class MinimizeEnergyProp(QDialog, SponsorableMixin, GroupButtonMixin, Ui_MinimizeEnergyPropDialog): @@ -139,7 +139,7 @@ class MinimizeEnergyProp(QDialog, SponsorableMixin, GroupButtonMixin, Ui_Minimiz def setup_ruc(self): "#doc" #bruce 060705 use new common code, if it works - from widget_controllers import realtime_update_controller + from widgets.widget_controllers import realtime_update_controller self.ruc = realtime_update_controller( #( self.update_btngrp, self.update_number_spinbox, self.update_units_combobox ), ( self.update_btngrp_group, self.update_number_spinbox, self.update_units_combobox ), @@ -208,9 +208,9 @@ class MinimizeEnergyProp(QDialog, SponsorableMixin, GroupButtonMixin, Ui_Minimiz # (should we pass these as arg to Minimize_CommandRun rather than thru env.prefs??) if debug_flags.atom_debug: print "debug: reloading runSim on each use, for development" - import runSim, debug + import simulation.runSim as runSim, utilities.debug as debug debug.reload_once_per_event(runSim) - from runSim import Minimize_CommandRun + from simulation.runSim import Minimize_CommandRun # do this in gather? if self.minimize_all_rbtn.isChecked(): self.seltype = 'All' diff --git a/cad/src/commands/Move/MovePropertyManager.py b/cad/src/commands/Move/MovePropertyManager.py index e9e8f4958..9b8381190 100755 --- a/cad/src/commands/Move/MovePropertyManager.py +++ b/cad/src/commands/Move/MovePropertyManager.py @@ -601,7 +601,7 @@ class MovePropertyManager(Ui_MovePropertyManager): self.MessageGroupBox.insertHtmlMessage( msg, setAsDefault = True ) return - from ops_select import objectSelected + from operations.ops_select import objectSelected if objectSelected(self.o.assy): msg = "" else: diff --git a/cad/src/commands/Move/Move_Command.py b/cad/src/commands/Move/Move_Command.py index 8b302df9e..a640cbe54 100755 --- a/cad/src/commands/Move/Move_Command.py +++ b/cad/src/commands/Move/Move_Command.py @@ -27,13 +27,13 @@ import foundation.changes as changes from PyQt4 import QtGui from PyQt4.Qt import SIGNAL from commands.Move.MovePropertyManager import MovePropertyManager -from icon_utilities import geticon +from utilities.icon_utilities import geticon from commands.SelectChunks.SelectChunks_Command import SelectChunks_basicCommand from command_support.GraphicsMode_API import GraphicsMode_API from geometry.BoundingBox import BBox from utilities.Log import redmsg from geometry.VQT import V, Q -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from commands.Translate.TranslateChunks_GraphicsMode import TranslateChunks_GraphicsMode from commands.Rotate.RotateChunks_GraphicsMode import RotateChunks_GraphicsMode diff --git a/cad/src/commands/Move/Move_GraphicsMode.py b/cad/src/commands/Move/Move_GraphicsMode.py index 9fa7ad02b..d99be27a2 100755 --- a/cad/src/commands/Move/Move_GraphicsMode.py +++ b/cad/src/commands/Move/Move_GraphicsMode.py @@ -19,10 +19,10 @@ from PyQt4.Qt import Qt import foundation.env as env from geometry.VQT import V, Q, A, vlen, norm from commands.SelectChunks.SelectChunks_GraphicsMode import SelectChunks_GraphicsMode -from constants import SUBTRACT_FROM_SELECTION -from constants import ADD_TO_SELECTION -from constants import START_NEW_SELECTION -from constants import DELETE_SELECTION +from utilities.constants import SUBTRACT_FROM_SELECTION +from utilities.constants import ADD_TO_SELECTION +from utilities.constants import START_NEW_SELECTION +from utilities.constants import DELETE_SELECTION _superclass = SelectChunks_GraphicsMode diff --git a/cad/src/commands/PartLibrary/PartLibraryMode.py b/cad/src/commands/PartLibrary/PartLibraryMode.py index 2335ce09f..8ef2cdab1 100644 --- a/cad/src/commands/PartLibrary/PartLibraryMode.py +++ b/cad/src/commands/PartLibrary/PartLibraryMode.py @@ -30,7 +30,7 @@ from utilities.Log import orangemsg, greenmsg, quote_html, redmsg from model.chem import Atom from model.elements import Singlet from geometry.VQT import Q -from ops_copy import copied_nodes_for_DND +from operations.ops_copy import copied_nodes_for_DND from commands.Paste.PasteMode import PasteMode from commands.PartLibrary.PartLibPropertyManager import PartLibPropertyManager @@ -318,7 +318,7 @@ class PartLibraryMode(PasteMode): #so we should turn this into history message, # not a bug print. But I'm not positive it's possible #w/o a bug, so review first. ###FIX [bruce 070501 comment] - import debug + import utilities.debug as debug debug._bugnodes = nodes newnodes = [] msg = redmsg( "error: nothing to deposit in [%s]" % quote_html(str(newPart.name)) ) @@ -340,7 +340,7 @@ class PartLibraryMode(PasteMode): #saved only once by users (due to NE1 bug in save) dirjunk, base = os.path.split(newPart.name) basename, extjunk = os.path.splitext(base) - from constants import gensym + from utilities.constants import gensym newnode.name = gensym( basename + " " ) # name library part #based on basename recorded in its mmp file's top node newnode.move(moveOffset) #k not sure this method is correctly diff --git a/cad/src/commands/Paste/PasteMode.py b/cad/src/commands/Paste/PasteMode.py index 4703cadd2..e22b2e596 100644 --- a/cad/src/commands/Paste/PasteMode.py +++ b/cad/src/commands/Paste/PasteMode.py @@ -28,10 +28,10 @@ from foundation.Group import Group from model.chem import Atom from model.chunk import Chunk from model.elements import Singlet -from pastables import is_pastable +from operations.pastables import is_pastable from commands.BuildAtoms.depositMode import depositMode -from pastables import find_hotspot_for_pasting +from operations.pastables import find_hotspot_for_pasting from model.bonds import bond_at_singlets from commands.Paste.PastePropertyManager import PastePropertyManager diff --git a/cad/src/commands/PlayMovie/MoviePropertyManager.py b/cad/src/commands/PlayMovie/MoviePropertyManager.py index 81795f2dc..fdbc30db8 100755 --- a/cad/src/commands/PlayMovie/MoviePropertyManager.py +++ b/cad/src/commands/PlayMovie/MoviePropertyManager.py @@ -16,7 +16,7 @@ from commands.PlayMovie.Ui_MoviePropertyManager import Ui_MoviePropertyManager from PyQt4.Qt import Qt, SIGNAL, QFileDialog, QString, QMessageBox import os, foundation.env as env from utilities.Log import redmsg, greenmsg -from constants import filesplit +from utilities.constants import filesplit class MoviePropertyManager(Ui_MoviePropertyManager): """ @@ -304,7 +304,7 @@ class MoviePropertyManager(Ui_MoviePropertyManager): # Check if file with name fn is a movie file which is valid for the current Part # [bruce 050324 made that a function and made it print the history messages # which I've commented out below.] - from movie import _checkMovieFile + from simulation.movie import _checkMovieFile r = _checkMovieFile(self.w.assy.part, fn) if r == 1: @@ -320,7 +320,7 @@ class MoviePropertyManager(Ui_MoviePropertyManager): return #bruce 050427 rewrote the following to use a new Movie object - from movie import find_saved_movie + from simulation.movie import find_saved_movie new_movie = find_saved_movie( self.w.assy, fn ) if new_movie: new_movie.set_alist_from_entire_part(self.w.assy.part) # kluge? might need changing... diff --git a/cad/src/commands/PlayMovie/Ui_MoviePropertyManager.py b/cad/src/commands/PlayMovie/Ui_MoviePropertyManager.py index 9aa276e5d..abf81908c 100755 --- a/cad/src/commands/PlayMovie/Ui_MoviePropertyManager.py +++ b/cad/src/commands/PlayMovie/Ui_MoviePropertyManager.py @@ -33,8 +33,8 @@ from PM.PM_Constants import pmDoneButton from PM.PM_Constants import pmWhatsThisButton from PM.PM_Constants import pmCancelButton -from NE1ToolBar import NE1ToolBar -from icon_utilities import geticon +from widgets.NE1ToolBar import NE1ToolBar +from utilities.icon_utilities import geticon class Ui_MoviePropertyManager(PM_Dialog): """ diff --git a/cad/src/commands/PlayMovie/movieMode.py b/cad/src/commands/PlayMovie/movieMode.py index b0ccd6e82..167ec88e6 100755 --- a/cad/src/commands/PlayMovie/movieMode.py +++ b/cad/src/commands/PlayMovie/movieMode.py @@ -27,14 +27,14 @@ from PyQt4.Qt import QMessageBox, QString, QWidgetAction, QAction import foundation.env as env import foundation.changes as changes -from movie import find_saved_movie +from simulation.movie import find_saved_movie from command_support.modes import basicMode from utilities.Log import greenmsg from utilities.Log import redmsg, orangemsg from commands.PlayMovie.MoviePropertyManager import MoviePropertyManager -from icon_utilities import geticon +from utilities.icon_utilities import geticon -from prefs_constants import workingDirectory_prefs_key +from utilities.prefs_constants import workingDirectory_prefs_key class MovieRewindDialog(QDialog): @@ -388,7 +388,7 @@ def simMoviePlayer(assy): either the current movie if any, or a previously saved dpb file with the same name as the current part, if one can be found. """ - from movie import find_saved_movie, Movie #bruce 050329 precaution (in case of similar bug to bug 499) + from simulation.movie import find_saved_movie, Movie #bruce 050329 precaution (in case of similar bug to bug 499) win = assy.w if not assy.molecules: # No model, so no movie could be valid for current part. # bruce 050327 comment: even so, a movie file might be valid for some other Part... diff --git a/cad/src/commands/Plot/PlotTool.py b/cad/src/commands/Plot/PlotTool.py index a921af5f8..749a56b44 100755 --- a/cad/src/commands/Plot/PlotTool.py +++ b/cad/src/commands/Plot/PlotTool.py @@ -19,10 +19,10 @@ from PyQt4.Qt import QStringList from commands.Plot.PlotToolDialog import Ui_PlotToolDialog from utilities.Log import redmsg, greenmsg, orangemsg -from movie import find_saved_movie -from PlatformDependent import open_file_in_editor +from simulation.movie import find_saved_movie +from platform.PlatformDependent import open_file_in_editor import foundation.env as env -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback debug_gnuplot = False @@ -289,7 +289,7 @@ class PlotTool(QWidget, Ui_PlotToolDialog): plotProcess = None try: - from Process import Process + from processes.Process import Process plotProcess = Process() # Run gnuplot as a new, separate process. diff --git a/cad/src/commands/PovraySceneProperties/PovraySceneProp.py b/cad/src/commands/PovraySceneProperties/PovraySceneProp.py index 0c16cc375..194faab46 100755 --- a/cad/src/commands/PovraySceneProperties/PovraySceneProp.py +++ b/cad/src/commands/PovraySceneProperties/PovraySceneProp.py @@ -14,8 +14,8 @@ from PyQt4.Qt import SIGNAL, QDialog, QWhatsThis, QDialog from commands.PovraySceneProperties.PovrayScenePropDialog import Ui_PovrayScenePropDialog import foundation.env as env, os from utilities.Log import redmsg, greenmsg -from GroupButtonMixin import GroupButtonMixin -from Sponsors import SponsorableMixin +from PM.GroupButtonMixin import GroupButtonMixin +from sponsors.Sponsors import SponsorableMixin from utilities.Comparison import same_vals class PovraySceneProp(QDialog, SponsorableMixin, GroupButtonMixin, Ui_PovrayScenePropDialog): diff --git a/cad/src/commands/PovraySceneProperties/PovrayScenePropDialog.py b/cad/src/commands/PovraySceneProperties/PovrayScenePropDialog.py index 3b9175d3a..a1226bf23 100755 --- a/cad/src/commands/PovraySceneProperties/PovrayScenePropDialog.py +++ b/cad/src/commands/PovraySceneProperties/PovrayScenePropDialog.py @@ -9,9 +9,9 @@ # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui -from icon_utilities import geticon -from PropMgr_Constants import getHeaderFont -from PropMgr_Constants import pmLabelLeftAlignment +from utilities.icon_utilities import geticon +from PM.PropMgr_Constants import getHeaderFont +from PM.PropMgr_Constants import pmLabelLeftAlignment class Ui_PovrayScenePropDialog(object): def setupUi(self, PovrayScenePropDialog): diff --git a/cad/src/commands/RotaryMotorProperties/RotaryMotorPropertyManager.py b/cad/src/commands/RotaryMotorProperties/RotaryMotorPropertyManager.py index aa7581ebf..8d3838af2 100755 --- a/cad/src/commands/RotaryMotorProperties/RotaryMotorPropertyManager.py +++ b/cad/src/commands/RotaryMotorProperties/RotaryMotorPropertyManager.py @@ -23,7 +23,7 @@ from PM.PM_CheckBox import PM_CheckBox from PM.PM_PushButton import PM_PushButton from widgets.widget_helpers import RGBf_to_QColor -from constants import gray +from utilities.constants import gray from command_support.MotorPropertyManager import MotorPropertyManager diff --git a/cad/src/commands/RotaryMotorProperties/RotaryMotor_EditCommand.py b/cad/src/commands/RotaryMotorProperties/RotaryMotor_EditCommand.py index 7461d6ec3..317300296 100644 --- a/cad/src/commands/RotaryMotorProperties/RotaryMotor_EditCommand.py +++ b/cad/src/commands/RotaryMotorProperties/RotaryMotor_EditCommand.py @@ -13,7 +13,7 @@ ninad 2007-10-09: Created. This deprecates 'RotoryMotorGenerator' import foundation.env as env from utilities.Log import redmsg, greenmsg, orangemsg from model.jigs_motors import RotaryMotor -from jigmakers_Mixin import atom_limit_exceeded_and_confirmed +from operations.jigmakers_Mixin import atom_limit_exceeded_and_confirmed from command_support.EditCommand import EditCommand from commands.SelectAtoms.SelectAtoms_GraphicsMode import SelectAtoms_GraphicsMode diff --git a/cad/src/commands/Rotate/RotateChunks_GraphicsMode.py b/cad/src/commands/Rotate/RotateChunks_GraphicsMode.py index be854c018..5f0d9e0ff 100755 --- a/cad/src/commands/Rotate/RotateChunks_GraphicsMode.py +++ b/cad/src/commands/Rotate/RotateChunks_GraphicsMode.py @@ -22,7 +22,7 @@ from Numeric import dot, sign import foundation.env as env from utilities.Log import redmsg -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from geometry.VQT import V, Q, A, vlen, norm from commands.Move.Move_GraphicsMode import Move_GraphicsMode diff --git a/cad/src/commands/Select/Select_GraphicsMode.py b/cad/src/commands/Select/Select_GraphicsMode.py index 9895d7f68..1895dbf42 100755 --- a/cad/src/commands/Select/Select_GraphicsMode.py +++ b/cad/src/commands/Select/Select_GraphicsMode.py @@ -79,19 +79,19 @@ from OpenGL.GL import glSelectBuffer from OpenGL.GLU import gluProject from OpenGL.GLU import gluUnProject -from constants import GL_FAR_Z -from constants import SELSHAPE_RECT -from constants import SELSHAPE_LASSO -from constants import SUBTRACT_FROM_SELECTION -from constants import ADD_TO_SELECTION -from constants import START_NEW_SELECTION -from constants import DELETE_SELECTION +from utilities.constants import GL_FAR_Z +from utilities.constants import SELSHAPE_RECT +from utilities.constants import SELSHAPE_LASSO +from utilities.constants import SUBTRACT_FROM_SELECTION +from utilities.constants import ADD_TO_SELECTION +from utilities.constants import START_NEW_SELECTION +from utilities.constants import DELETE_SELECTION -from constants import black +from utilities.constants import black import foundation.env as env -from debug_prefs import debug_pref -from debug_prefs import Choice +from utilities.debug_prefs import debug_pref +from utilities.debug_prefs import Choice from geometry.VQT import V, A, vlen @@ -100,11 +100,11 @@ from model.bonds import Bond from model.chem import Atom from model.jigs import Jig -from debug import print_compact_traceback -from debug import print_compact_stack +from utilities.debug import print_compact_traceback +from utilities.debug import print_compact_stack -from prefs_constants import bondHighlightColor_prefs_key -from prefs_constants import deleteBondHighlightColor_prefs_key +from utilities.prefs_constants import bondHighlightColor_prefs_key +from utilities.prefs_constants import deleteBondHighlightColor_prefs_key from utilities import debug_flags diff --git a/cad/src/commands/Select/Select_GraphicsMode_DrawMethod_preMixin.py b/cad/src/commands/Select/Select_GraphicsMode_DrawMethod_preMixin.py index cf3571563..8afae3f52 100755 --- a/cad/src/commands/Select/Select_GraphicsMode_DrawMethod_preMixin.py +++ b/cad/src/commands/Select/Select_GraphicsMode_DrawMethod_preMixin.py @@ -26,9 +26,9 @@ from OpenGL.GL import glTranslate from utilities.Log import redmsg -from debug_prefs import debug_pref -from debug_prefs import Choice -from debug import print_compact_stack +from utilities.debug_prefs import debug_pref +from utilities.debug_prefs import Choice +from utilities.debug import print_compact_stack from command_support.GraphicsMode import commonGraphicsMode diff --git a/cad/src/commands/Select/Select_GraphicsMode_MouseHelpers_preMixin.py b/cad/src/commands/Select/Select_GraphicsMode_MouseHelpers_preMixin.py index 74873008c..0330b85df 100755 --- a/cad/src/commands/Select/Select_GraphicsMode_MouseHelpers_preMixin.py +++ b/cad/src/commands/Select/Select_GraphicsMode_MouseHelpers_preMixin.py @@ -23,10 +23,10 @@ import foundation.env as env from model.bonds import Bond from model.chem import Atom from model.jigs import Jig -from debug import print_compact_stack +from utilities.debug import print_compact_stack debug_update_selobj_calls = False # do not commit with true -from GlobalPreferences import DEBUG_BAREMOTION, DEBUG_BAREMOTION_VERBOSE +from utilities.GlobalPreferences import DEBUG_BAREMOTION, DEBUG_BAREMOTION_VERBOSE _count = 0 diff --git a/cad/src/commands/Select/selectMode.py b/cad/src/commands/Select/selectMode.py index 71d1e08d8..74a1de724 100755 --- a/cad/src/commands/Select/selectMode.py +++ b/cad/src/commands/Select/selectMode.py @@ -32,7 +32,7 @@ from commands.Select.Select_GraphicsMode import Select_basicGraphicsMode from command_support.modes import anyMode -from constants import GLPANE_IS_COMMAND_SEQUENCER +from utilities.constants import GLPANE_IS_COMMAND_SEQUENCER class selectMode(Select_basicCommand, Select_basicGraphicsMode, diff --git a/cad/src/commands/SelectAtoms/SelectAtoms_Command.py b/cad/src/commands/SelectAtoms/SelectAtoms_Command.py index 9050e7ff4..72826c8fb 100755 --- a/cad/src/commands/SelectAtoms/SelectAtoms_Command.py +++ b/cad/src/commands/SelectAtoms/SelectAtoms_Command.py @@ -29,8 +29,8 @@ Ninad & Bruce 2007-12-13: Created new Command and GraphicsMode classes from """ from utilities import debug_flags -from runSim import LocalMinimize_function -from debug import print_compact_traceback +from simulation.runSim import LocalMinimize_function +from utilities.debug import print_compact_traceback from commands.Select.Select_Command import Select_basicCommand from command_support.GraphicsMode_API import GraphicsMode_API @@ -140,7 +140,7 @@ class SelectAtoms_basicCommand(Select_basicCommand): if debug_flags.atom_debug: print "debug: reloading runSim on each use, for development"\ "[localmin %s, %d]" % (atom, nlayers) - import runSim, debug + import simulation.runSim as runSim, utilities.debug as debug debug.reload_once_per_event(runSim) #bruce 060705 revised this if 1: # this does not work, diff --git a/cad/src/commands/SelectAtoms/SelectAtoms_GraphicsMode.py b/cad/src/commands/SelectAtoms/SelectAtoms_GraphicsMode.py index b0752c11e..43c82dc71 100755 --- a/cad/src/commands/SelectAtoms/SelectAtoms_GraphicsMode.py +++ b/cad/src/commands/SelectAtoms/SelectAtoms_GraphicsMode.py @@ -40,21 +40,21 @@ from model.jigs import Jig from model.bonds import Bond from model.elements import Singlet -from debug import print_compact_traceback, print_compact_stack +from utilities.debug import print_compact_traceback, print_compact_stack from foundation.Group import Group from commands.Select.Select_GraphicsMode import DRAG_STICKINESS_LIMIT -from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False +from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False -from prefs_constants import bondHighlightColor_prefs_key -from prefs_constants import bondpointHighlightColor_prefs_key -from prefs_constants import atomHighlightColor_prefs_key -from prefs_constants import deleteBondHighlightColor_prefs_key -from prefs_constants import deleteAtomHighlightColor_prefs_key +from utilities.prefs_constants import bondHighlightColor_prefs_key +from utilities.prefs_constants import bondpointHighlightColor_prefs_key +from utilities.prefs_constants import atomHighlightColor_prefs_key +from utilities.prefs_constants import deleteBondHighlightColor_prefs_key +from utilities.prefs_constants import deleteAtomHighlightColor_prefs_key -from constants import average_value +from utilities.constants import average_value from utilities.Log import orangemsg diff --git a/cad/src/commands/SelectAtoms/selectAtomsMode.py b/cad/src/commands/SelectAtoms/selectAtomsMode.py index 11bf6153b..a83792ffb 100755 --- a/cad/src/commands/SelectAtoms/selectAtomsMode.py +++ b/cad/src/commands/SelectAtoms/selectAtomsMode.py @@ -31,8 +31,8 @@ Ninad & Bruce 2007-12-13: Created new Command and GraphicsMode classes from """ -from debug import print_compact_traceback -from constants import GLPANE_IS_COMMAND_SEQUENCER +from utilities.debug import print_compact_traceback +from utilities.constants import GLPANE_IS_COMMAND_SEQUENCER from commands.SelectAtoms.SelectAtoms_Command import SelectAtoms_basicCommand from commands.SelectAtoms.SelectAtoms_GraphicsMode import SelectAtoms_basicGraphicsMode diff --git a/cad/src/commands/SelectChunks/SelectChunks_GraphicsMode.py b/cad/src/commands/SelectChunks/SelectChunks_GraphicsMode.py index 75db04953..d348bc232 100755 --- a/cad/src/commands/SelectChunks/SelectChunks_GraphicsMode.py +++ b/cad/src/commands/SelectChunks/SelectChunks_GraphicsMode.py @@ -39,11 +39,11 @@ from commands.Select.Select_GraphicsMode import DRAG_STICKINESS_LIMIT from model.chunk import Chunk from graphics.drawing.drawer import apply_material, allow_color_sorting, use_color_sorted_dls from OpenGL.GL import glCallList -from debug import print_compact_traceback, print_compact_stack +from utilities.debug import print_compact_traceback, print_compact_stack -from constants import yellow, orange, ave_colors, red +from utilities.constants import yellow, orange, ave_colors, red -from debug_prefs import debug_pref, Choice_boolean_True +from utilities.debug_prefs import debug_pref, Choice_boolean_True from utilities import debug_flags from geometry.VQT import V, vlen @@ -52,7 +52,7 @@ import time from commands.Select.Select_GraphicsMode import Select_basicGraphicsMode -from GlobalPreferences import DEBUG_BAREMOTION +from utilities.GlobalPreferences import DEBUG_BAREMOTION _superclass = Select_basicGraphicsMode diff --git a/cad/src/commands/SelectChunks/selectMolsMode.py b/cad/src/commands/SelectChunks/selectMolsMode.py index 8c6bdbb54..996f8804c 100755 --- a/cad/src/commands/SelectChunks/selectMolsMode.py +++ b/cad/src/commands/SelectChunks/selectMolsMode.py @@ -16,7 +16,7 @@ Ninad & Bruce 2007-12-13: Created new Command and GraphicsMode classes from SelectChunks_GraphicsMode.py] """ -from constants import GLPANE_IS_COMMAND_SEQUENCER +from utilities.constants import GLPANE_IS_COMMAND_SEQUENCER from commands.SelectChunks.SelectChunks_Command import SelectChunks_basicCommand from commands.SelectChunks.SelectChunks_GraphicsMode import SelectChunks_basicGraphicsMode diff --git a/cad/src/commands/Translate/TranslateChunks_GraphicsMode.py b/cad/src/commands/Translate/TranslateChunks_GraphicsMode.py index 20dc8a592..5d4bc1b16 100755 --- a/cad/src/commands/Translate/TranslateChunks_GraphicsMode.py +++ b/cad/src/commands/Translate/TranslateChunks_GraphicsMode.py @@ -18,7 +18,7 @@ from utilities import debug_flags import math from Numeric import dot import foundation.env as env -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from geometry.VQT import V, A, vlen, norm from commands.Move.Move_GraphicsMode import Move_GraphicsMode diff --git a/cad/src/dna/DnaSequenceEditor/DnaSequenceEditor.py b/cad/src/dna/DnaSequenceEditor/DnaSequenceEditor.py index 48dc8b088..f4af48cbf 100644 --- a/cad/src/dna/DnaSequenceEditor/DnaSequenceEditor.py +++ b/cad/src/dna/DnaSequenceEditor/DnaSequenceEditor.py @@ -53,12 +53,12 @@ from dna.model.Dna_Constants import getReverseSequence from PM.PM_Colors import pmMessageBoxColor -from prefs_constants import workingDirectory_prefs_key +from utilities.prefs_constants import workingDirectory_prefs_key from dna.DnaSequenceEditor.Ui_DnaSequenceEditor import Ui_DnaSequenceEditor from utilities import debug_flags -from debug import print_compact_stack +from utilities.debug import print_compact_stack class DnaSequenceEditor(Ui_DnaSequenceEditor): """ diff --git a/cad/src/dna/DnaSequenceEditor/Ui_DnaSequenceEditor.py b/cad/src/dna/DnaSequenceEditor/Ui_DnaSequenceEditor.py index e0fa04697..00d0294eb 100644 --- a/cad/src/dna/DnaSequenceEditor/Ui_DnaSequenceEditor.py +++ b/cad/src/dna/DnaSequenceEditor/Ui_DnaSequenceEditor.py @@ -30,7 +30,7 @@ from PM.PM_TextEdit import PM_TextEdit from PM.PM_LineEdit import PM_LineEdit from PM.PM_PushButton import PM_PushButton -from icon_utilities import geticon, getpixmap +from utilities.icon_utilities import geticon, getpixmap class Ui_DnaSequenceEditor(PM_DockWidget): """ diff --git a/cad/src/dna/commands/BreakStrands/BreakStrands_Command.py b/cad/src/dna/commands/BreakStrands/BreakStrands_Command.py index 716ad64c5..bab63173d 100644 --- a/cad/src/dna/commands/BreakStrands/BreakStrands_Command.py +++ b/cad/src/dna/commands/BreakStrands/BreakStrands_Command.py @@ -14,10 +14,10 @@ TODOs: [ as of 2008-01-04] import foundation.changes as changes from commands.BuildAtoms.BuildAtoms_GraphicsMode import BuildAtoms_GraphicsMode from commands.BuildAtoms.BuildAtoms_Command import BuildAtoms_Command -from constants import red +from utilities.constants import red from dna.commands.BreakStrands.BreakStrands_PropertyManager import BreakStrands_PropertyManager -from TemporaryCommand import ESC_to_exit_GraphicsMode_preMixin +from temporary_commands.TemporaryCommand import ESC_to_exit_GraphicsMode_preMixin # == GraphicsMode part _superclass_for_GM = BuildAtoms_GraphicsMode diff --git a/cad/src/dna/commands/BreakStrands/BreakStrands_PropertyManager.py b/cad/src/dna/commands/BreakStrands/BreakStrands_PropertyManager.py index d12b7b6bc..e4552a300 100644 --- a/cad/src/dna/commands/BreakStrands/BreakStrands_PropertyManager.py +++ b/cad/src/dna/commands/BreakStrands/BreakStrands_PropertyManager.py @@ -18,7 +18,7 @@ button code (confirmation_corner) pending because of some remaining things in GBC cleanup (such as NanotubeGenerator etc) """ -from DebugMenuMixin import DebugMenuMixin +from widgets.DebugMenuMixin import DebugMenuMixin from PM.PM_Dialog import PM_Dialog from PM.PM_Constants import pmDoneButton from PM.PM_Constants import pmWhatsThisButton diff --git a/cad/src/dna/commands/BuildDna/BuildDna_EditCommand.py b/cad/src/dna/commands/BuildDna/BuildDna_EditCommand.py index 65c80b677..4e4cee6dc 100644 --- a/cad/src/dna/commands/BuildDna/BuildDna_EditCommand.py +++ b/cad/src/dna/commands/BuildDna/BuildDna_EditCommand.py @@ -26,7 +26,7 @@ from dna.model.DnaGroup import DnaGroup from utilities.Log import greenmsg from command_support.GeneratorBaseClass import PluginBug, UserError -from constants import gensym +from utilities.constants import gensym from ne1_ui.toolbars.Ui_DnaFlyout import DnaFlyout diff --git a/cad/src/dna/commands/BuildDna/BuildDna_PropertyManager.py b/cad/src/dna/commands/BuildDna/BuildDna_PropertyManager.py index 81244a906..ecf3ebddc 100644 --- a/cad/src/dna/commands/BuildDna/BuildDna_PropertyManager.py +++ b/cad/src/dna/commands/BuildDna/BuildDna_PropertyManager.py @@ -22,7 +22,7 @@ BUGS: - Just entering and leaving BuilddDna_EditCommand creates an empty DnaGroup """ from utilities import debug_flags -from debug import print_compact_stack +from utilities.debug import print_compact_stack from PyQt4.Qt import SIGNAL from PyQt4.Qt import QString @@ -31,7 +31,7 @@ from PM.PM_GroupBox import PM_GroupBox from PM.PM_PushButton import PM_PushButton from PM.PM_SelectionListWidget import PM_SelectionListWidget -from DebugMenuMixin import DebugMenuMixin +from widgets.DebugMenuMixin import DebugMenuMixin from command_support.EditCommand_PM import EditCommand_PM from PM.PM_Constants import pmDoneButton diff --git a/cad/src/dna/commands/BuildDuplex/DnaDuplex.py b/cad/src/dna/commands/BuildDuplex/DnaDuplex.py index f31f04ae7..3cfc02844 100644 --- a/cad/src/dna/commands/BuildDuplex/DnaDuplex.py +++ b/cad/src/dna/commands/BuildDuplex/DnaDuplex.py @@ -18,21 +18,21 @@ import random from math import sin, cos, pi -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from PlatformDependent import find_plugin_dir +from platform.PlatformDependent import find_plugin_dir from files.mmp.files_mmp import readmmp from geometry.VQT import Q, V, angleBetween, cross, vlen from commands.Fuse.fusechunksMode import fusechunksBase from utilities.Log import orangemsg from command_support.GeneratorBaseClass import PluginBug -from constants import gensym, darkred, blue, orange, olive -from constants import diBALL, diTUBES -from prefs_constants import dnaDefaultSegmentColor_prefs_key +from utilities.constants import gensym, darkred, blue, orange, olive +from utilities.constants import diBALL, diTUBES +from utilities.prefs_constants import dnaDefaultSegmentColor_prefs_key from dna.model.Dna_Constants import getDuplexBasesPerTurn -from runSim import adjustSinglet +from simulation.runSim import adjustSinglet from model.elements import PeriodicTable Element_Ae3 = PeriodicTable.getElement('Ae3') diff --git a/cad/src/dna/commands/BuildDuplex/DnaDuplexPropertyManager.py b/cad/src/dna/commands/BuildDuplex/DnaDuplexPropertyManager.py index 8901d9a01..d6a2db305 100644 --- a/cad/src/dna/commands/BuildDuplex/DnaDuplexPropertyManager.py +++ b/cad/src/dna/commands/BuildDuplex/DnaDuplexPropertyManager.py @@ -35,7 +35,7 @@ from PM.PM_ToolButton import PM_ToolButton from PM.PM_CoordinateSpinBoxes import PM_CoordinateSpinBoxes from PM.PM_CheckBox import PM_CheckBox -from DebugMenuMixin import DebugMenuMixin +from widgets.DebugMenuMixin import DebugMenuMixin from command_support.EditCommand_PM import EditCommand_PM from geometry.VQT import V diff --git a/cad/src/dna/commands/BuildDuplex/DnaDuplex_EditCommand.py b/cad/src/dna/commands/BuildDuplex/DnaDuplex_EditCommand.py index 8e8c432af..8f779d520 100644 --- a/cad/src/dna/commands/BuildDuplex/DnaDuplex_EditCommand.py +++ b/cad/src/dna/commands/BuildDuplex/DnaDuplex_EditCommand.py @@ -35,7 +35,7 @@ from command_support.EditCommand import EditCommand from dna.model.DnaSegment import DnaSegment from dna.model.DnaGroup import DnaGroup -from debug import print_compact_stack +from utilities.debug import print_compact_stack from utilities.Log import redmsg, greenmsg from geometry.VQT import V, Veq, vlen @@ -45,7 +45,7 @@ from dna.commands.BuildDuplex.DnaDuplex import B_Dna_PAM5 from command_support.GeneratorBaseClass import PluginBug, UserError from dna.commands.BuildDuplex.DnaDuplexPropertyManager import DnaDuplexPropertyManager -from constants import gensym +from utilities.constants import gensym from dna.model.Dna_Constants import getNumberOfBasePairsFromDuplexLength diff --git a/cad/src/dna/commands/BuildDuplex_old/DnaGenHelper.py b/cad/src/dna/commands/BuildDuplex_old/DnaGenHelper.py index 97e2de8eb..e03bbb351 100755 --- a/cad/src/dna/commands/BuildDuplex_old/DnaGenHelper.py +++ b/cad/src/dna/commands/BuildDuplex_old/DnaGenHelper.py @@ -45,9 +45,9 @@ import re from math import sin, cos, pi -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from PlatformDependent import find_plugin_dir +from platform.PlatformDependent import find_plugin_dir from files.mmp.files_mmp import readmmp from geometry.VQT import V from commands.Fuse.fusechunksMode import fusechunksBase diff --git a/cad/src/dna/commands/BuildDuplex_old/DnaGenerator.py b/cad/src/dna/commands/BuildDuplex_old/DnaGenerator.py index 0646415d3..e4f09de5e 100755 --- a/cad/src/dna/commands/BuildDuplex_old/DnaGenerator.py +++ b/cad/src/dna/commands/BuildDuplex_old/DnaGenerator.py @@ -29,14 +29,14 @@ Mark 2007-10-18: import foundation.env as env import random -from constants import darkred, blue, lightgray +from utilities.constants import darkred, blue, lightgray from foundation.Group import Group from utilities.Log import redmsg, greenmsg ##, orangemsg from geometry.VQT import Q, V, angleBetween, cross, vlen, Veq from math import pi from model.chunk import Chunk -from constants import gensym +from utilities.constants import gensym from dna.model.Dna_Constants import basesDict, getReverseSequence from dna.commands.BuildDuplex_old.DnaGenHelper import B_Dna_PAM3, B_Dna_PAM5 diff --git a/cad/src/dna/commands/BuildDuplex_old/DnaGeneratorPropertyManager.py b/cad/src/dna/commands/BuildDuplex_old/DnaGeneratorPropertyManager.py index d6498a042..25f3b4b3b 100755 --- a/cad/src/dna/commands/BuildDuplex_old/DnaGeneratorPropertyManager.py +++ b/cad/src/dna/commands/BuildDuplex_old/DnaGeneratorPropertyManager.py @@ -66,7 +66,7 @@ from PM.PM_SpinBox import PM_SpinBox from PM.PM_TextEdit import PM_TextEdit from PM.PM_Dialog import PM_Dialog -from DebugMenuMixin import DebugMenuMixin +from widgets.DebugMenuMixin import DebugMenuMixin # DNA model type variables # (indices for model... and conformation... comboboxes). diff --git a/cad/src/dna/commands/DnaSegment/DnaSegment_EditCommand.py b/cad/src/dna/commands/DnaSegment/DnaSegment_EditCommand.py index a0b1f3e63..8785281a5 100644 --- a/cad/src/dna/commands/DnaSegment/DnaSegment_EditCommand.py +++ b/cad/src/dna/commands/DnaSegment/DnaSegment_EditCommand.py @@ -52,18 +52,18 @@ from dna.commands.BuildDuplex.DnaDuplex import B_Dna_PAM5 from command_support.GeneratorBaseClass import PluginBug, UserError -from constants import gensym +from utilities.constants import gensym from dna.model.Dna_Constants import getDuplexLength -from test_connectWithState import State_preMixin +from prototype.test_connectWithState import State_preMixin -from constants import noop +from utilities.constants import noop from exprs.attr_decl_macros import Instance, State from exprs.__Symbols__ import _self from exprs.Exprs import call_Expr from exprs.Exprs import norm_Expr -from prefs_widgets import ObjAttr_StateRef +from widgets.prefs_widgets import ObjAttr_StateRef from exprs.ExprsConstants import Width, Point from model.chunk import Chunk diff --git a/cad/src/dna/commands/DnaSegment/DnaSegment_GraphicsMode.py b/cad/src/dna/commands/DnaSegment/DnaSegment_GraphicsMode.py index 7c57e174e..eb7d407b8 100644 --- a/cad/src/dna/commands/DnaSegment/DnaSegment_GraphicsMode.py +++ b/cad/src/dna/commands/DnaSegment/DnaSegment_GraphicsMode.py @@ -39,17 +39,17 @@ from dna.commands.BuildDna.BuildDna_GraphicsMode import BuildDna_GraphicsMode from dna.model.DnaSegment import DnaSegment from dna.temporary_commands.DnaLineMode import DnaLine_GM -from TemporaryCommand import ESC_to_exit_GraphicsMode_preMixin +from temporary_commands.TemporaryCommand import ESC_to_exit_GraphicsMode_preMixin from graphics.drawing.drawDnaRibbons import drawDnaRibbons import foundation.env as env -from prefs_constants import bdnaBasesPerTurn_prefs_key +from utilities.prefs_constants import bdnaBasesPerTurn_prefs_key import math from geometry.VQT import V, norm, A, Q, vlen -from constants import darkred, blue, black -from debug import print_compact_traceback +from utilities.constants import darkred, blue, black +from utilities.debug import print_compact_traceback from commands.Select.Select_GraphicsMode import DRAG_STICKINESS_LIMIT diff --git a/cad/src/dna/commands/DnaSegment/DnaSegment_PropertyManager.py b/cad/src/dna/commands/DnaSegment/DnaSegment_PropertyManager.py index 7a8704fb3..1968c877d 100644 --- a/cad/src/dna/commands/DnaSegment/DnaSegment_PropertyManager.py +++ b/cad/src/dna/commands/DnaSegment/DnaSegment_PropertyManager.py @@ -10,7 +10,7 @@ See DnaSegment_EditCommand for details. from PyQt4.Qt import SIGNAL from PM.PM_GroupBox import PM_GroupBox -from DebugMenuMixin import DebugMenuMixin +from widgets.DebugMenuMixin import DebugMenuMixin from command_support.EditCommand_PM import EditCommand_PM from PM.PM_Constants import pmDoneButton diff --git a/cad/src/dna/commands/DnaSegment/DnaSegment_ResizeHandle.py b/cad/src/dna/commands/DnaSegment/DnaSegment_ResizeHandle.py index 83af42e59..48519e3e2 100644 --- a/cad/src/dna/commands/DnaSegment/DnaSegment_ResizeHandle.py +++ b/cad/src/dna/commands/DnaSegment/DnaSegment_ResizeHandle.py @@ -24,8 +24,8 @@ from exprs.Rect import Sphere from exprs.Arrow import Arrow -from constants import yellow, darkgreen -from constants import olive +from utilities.constants import yellow, darkgreen +from utilities.constants import olive from geometry.VQT import V from exprs.DraggableHandle import DraggableHandle_AlongLine diff --git a/cad/src/dna/commands/DnaStrand/DnaStrand_EditCommand.py b/cad/src/dna/commands/DnaStrand/DnaStrand_EditCommand.py index 83413d9ba..1847ab262 100644 --- a/cad/src/dna/commands/DnaStrand/DnaStrand_EditCommand.py +++ b/cad/src/dna/commands/DnaStrand/DnaStrand_EditCommand.py @@ -17,18 +17,18 @@ TODO: as of 2008-02-14 methods in class dna_model.DnaSegment change. """ -from debug import print_compact_stack +from utilities.debug import print_compact_stack from geometry.VQT import V from geometry.VQT import vlen from geometry.VQT import norm -from test_connectWithState import State_preMixin +from prototype.test_connectWithState import State_preMixin from exprs.attr_decl_macros import Instance, State from exprs.__Symbols__ import _self from exprs.Exprs import call_Expr from exprs.Exprs import norm_Expr -from prefs_widgets import ObjAttr_StateRef +from widgets.prefs_widgets import ObjAttr_StateRef from exprs.ExprsConstants import Width, Point from model.chunk import Chunk @@ -40,7 +40,7 @@ from dna.commands.DnaStrand.DnaStrand_ResizeHandle import DnaStrand_ResizeHandle from command_support.EditCommand import EditCommand -from constants import noop +from utilities.constants import noop CYLINDER_WIDTH_DEFAULT_VALUE = 0.0 diff --git a/cad/src/dna/commands/DnaStrand/DnaStrand_GraphicsMode.py b/cad/src/dna/commands/DnaStrand/DnaStrand_GraphicsMode.py index a5e194bd3..dcbe04cb8 100644 --- a/cad/src/dna/commands/DnaStrand/DnaStrand_GraphicsMode.py +++ b/cad/src/dna/commands/DnaStrand/DnaStrand_GraphicsMode.py @@ -11,7 +11,7 @@ Created 2008-02-14 """ from dna.commands.BuildDna.BuildDna_GraphicsMode import BuildDna_GraphicsMode -from TemporaryCommand import ESC_to_exit_GraphicsMode_preMixin +from temporary_commands.TemporaryCommand import ESC_to_exit_GraphicsMode_preMixin _superclass = BuildDna_GraphicsMode diff --git a/cad/src/dna/commands/DnaStrand/DnaStrand_PropertyManager.py b/cad/src/dna/commands/DnaStrand/DnaStrand_PropertyManager.py index f842ae571..dacea17d9 100644 --- a/cad/src/dna/commands/DnaStrand/DnaStrand_PropertyManager.py +++ b/cad/src/dna/commands/DnaStrand/DnaStrand_PropertyManager.py @@ -12,12 +12,12 @@ its a child of that PM) . See if that creates any issues. - Copies some methods from BuildDna_PropertyManager. """ from utilities import debug_flags -from debug import print_compact_stack +from utilities.debug import print_compact_stack from PyQt4.Qt import SIGNAL from PyQt4.Qt import QString -from DebugMenuMixin import DebugMenuMixin +from widgets.DebugMenuMixin import DebugMenuMixin from command_support.EditCommand_PM import EditCommand_PM from PM.PM_Constants import pmDoneButton diff --git a/cad/src/dna/commands/DnaStrand/DnaStrand_ResizeHandle.py b/cad/src/dna/commands/DnaStrand/DnaStrand_ResizeHandle.py index e9fa7b33a..462a558cb 100644 --- a/cad/src/dna/commands/DnaStrand/DnaStrand_ResizeHandle.py +++ b/cad/src/dna/commands/DnaStrand/DnaStrand_ResizeHandle.py @@ -32,7 +32,7 @@ from exprs.ExprsConstants import ORIGIN, DX from exprs.dna_ribbon_view import Cylinder from exprs.Rect import Sphere -from constants import yellow, purple, darkgreen +from utilities.constants import yellow, purple, darkgreen from geometry.VQT import V from exprs.DraggableHandle import DraggableHandle_AlongLine diff --git a/cad/src/dna/commands/JoinStrands/JoinStrands_Command.py b/cad/src/dna/commands/JoinStrands/JoinStrands_Command.py index 7d1f0be4c..0ce3c84e1 100644 --- a/cad/src/dna/commands/JoinStrands/JoinStrands_Command.py +++ b/cad/src/dna/commands/JoinStrands/JoinStrands_Command.py @@ -13,7 +13,7 @@ import foundation.changes as changes from commands.BuildAtoms.BuildAtoms_GraphicsMode import BuildAtoms_GraphicsMode from commands.BuildAtoms.BuildAtoms_Command import BuildAtoms_Command from dna.commands.JoinStrands.JoinStrands_PropertyManager import JoinStrands_PropertyManager -from TemporaryCommand import ESC_to_exit_GraphicsMode_preMixin +from temporary_commands.TemporaryCommand import ESC_to_exit_GraphicsMode_preMixin # == GraphicsMode part _superclass_for_GM = BuildAtoms_GraphicsMode diff --git a/cad/src/dna/commands/JoinStrands/JoinStrands_PropertyManager.py b/cad/src/dna/commands/JoinStrands/JoinStrands_PropertyManager.py index 69ca36604..3d8e115c4 100644 --- a/cad/src/dna/commands/JoinStrands/JoinStrands_PropertyManager.py +++ b/cad/src/dna/commands/JoinStrands/JoinStrands_PropertyManager.py @@ -19,7 +19,7 @@ pending because of some remaining things in GBC cleanup (such as NanotubeGenerator etc) """ import sys -from DebugMenuMixin import DebugMenuMixin +from widgets.DebugMenuMixin import DebugMenuMixin from PM.PM_Dialog import PM_Dialog from PM.PM_Constants import pmDoneButton from PM.PM_Constants import pmWhatsThisButton diff --git a/cad/src/dna/model/Block.py b/cad/src/dna/model/Block.py index 1a06b9c46..e43d1d5ad 100644 --- a/cad/src/dna/model/Block.py +++ b/cad/src/dna/model/Block.py @@ -12,7 +12,7 @@ might be moved into a more general package. from foundation.Group import Group -from debug_prefs import debug_pref, Choice_boolean_False +from utilities.debug_prefs import debug_pref, Choice_boolean_False class Block(Group): """ diff --git a/cad/src/dna/model/DnaGroup.py b/cad/src/dna/model/DnaGroup.py index efca57d2c..9cc9c0d9b 100644 --- a/cad/src/dna/model/DnaGroup.py +++ b/cad/src/dna/model/DnaGroup.py @@ -10,9 +10,9 @@ DnaGroup.py - ... from dna.model.Block import Block from model.chunk import Chunk -from constants import gensym +from utilities.constants import gensym -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap from dna.updater.dna_updater_globals import _f_DnaGroup_for_homeless_objects_in_Part diff --git a/cad/src/dna/model/DnaLadderRailChunk.py b/cad/src/dna/model/DnaLadderRailChunk.py index 0d151197a..d6ee8cb6f 100644 --- a/cad/src/dna/model/DnaLadderRailChunk.py +++ b/cad/src/dna/model/DnaLadderRailChunk.py @@ -12,10 +12,10 @@ from model.chunk import Chunk from model.elements import Singlet from model.elements import Pl5 -from constants import gensym -from constants import black -from constants import ave_colors -from constants import diDEFAULT +from utilities.constants import gensym +from utilities.constants import black +from utilities.constants import ave_colors +from utilities.constants import diDEFAULT from utilities import debug_flags @@ -27,7 +27,7 @@ from utilities.Log import orangemsg, graymsg from PyQt4.Qt import QFont, QString # for debug code -from debug_prefs import debug_pref, Choice_boolean_False +from utilities.debug_prefs import debug_pref, Choice_boolean_False # see also: ## from dna_model.DnaLadder import _rail_end_atom_to_ladder diff --git a/cad/src/dna/model/DnaMarker.py b/cad/src/dna/model/DnaMarker.py index e83ccba0d..f0f114e4c 100644 --- a/cad/src/dna/model/DnaMarker.py +++ b/cad/src/dna/model/DnaMarker.py @@ -29,7 +29,7 @@ from utilities import debug_flags from graphics.drawing.drawer import drawwirecube -from constants import orange +from utilities.constants import orange from files.mmp.files_mmp_registration import MMP_RecordParser from files.mmp.files_mmp_registration import register_MMP_RecordParser diff --git a/cad/src/dna/model/DnaSegment.py b/cad/src/dna/model/DnaSegment.py index d5784b650..393338ca2 100644 --- a/cad/src/dna/model/DnaSegment.py +++ b/cad/src/dna/model/DnaSegment.py @@ -19,14 +19,14 @@ import foundation.env as env from dna.model.DnaStrandOrSegment import DnaStrandOrSegment from dna.model.DnaLadderRailChunk import DnaAxisChunk -from debug import print_compact_stack, print_compact_traceback +from utilities.debug import print_compact_stack, print_compact_traceback from model.chunk import Chunk from model.chem import Atom from model.bonds import Bond from geometry.VQT import V, norm, vlen from dna.model.Dna_Constants import getDuplexRiseFromNumberOfBasePairs -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap class DnaSegment(DnaStrandOrSegment): """ diff --git a/cad/src/dna/model/DnaStrand.py b/cad/src/dna/model/DnaStrand.py index 27480e4e4..13684e691 100644 --- a/cad/src/dna/model/DnaStrand.py +++ b/cad/src/dna/model/DnaStrand.py @@ -14,12 +14,12 @@ import re from dna.model.DnaStrandOrSegment import DnaStrandOrSegment from dna.model.DnaLadderRailChunk import DnaStrandChunk -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap -from debug import print_compact_stack +from utilities.debug import print_compact_stack from dna.model.Dna_Constants import getComplementSequence -from bond_chains import grow_directional_bond_chain +from operations.bond_chains import grow_directional_bond_chain class DnaStrand(DnaStrandOrSegment): """ diff --git a/cad/src/dna/model/Dna_Constants.py b/cad/src/dna/model/Dna_Constants.py index 2fed15c10..863540cca 100644 --- a/cad/src/dna/model/Dna_Constants.py +++ b/cad/src/dna/model/Dna_Constants.py @@ -22,11 +22,11 @@ History: """ import foundation.env as env -from constants import purple, brass, steelblue, lightgreen, darkgray, lightblue -from constants import darkorange, violet, copper, olive, gray -from prefs_constants import adnaBasesPerTurn_prefs_key, adnaRise_prefs_key -from prefs_constants import bdnaBasesPerTurn_prefs_key, bdnaRise_prefs_key -from prefs_constants import zdnaBasesPerTurn_prefs_key, zdnaRise_prefs_key +from utilities.constants import purple, brass, steelblue, lightgreen, darkgray, lightblue +from utilities.constants import darkorange, violet, copper, olive, gray +from utilities.prefs_constants import adnaBasesPerTurn_prefs_key, adnaRise_prefs_key +from utilities.prefs_constants import bdnaBasesPerTurn_prefs_key, bdnaRise_prefs_key +from utilities.prefs_constants import zdnaBasesPerTurn_prefs_key, zdnaRise_prefs_key from PyQt4.Qt import QString basesDict = \ diff --git a/cad/src/dna/model/WholeChain.py b/cad/src/dna/model/WholeChain.py index 4c4ac3738..df60d6b27 100644 --- a/cad/src/dna/model/WholeChain.py +++ b/cad/src/dna/model/WholeChain.py @@ -16,7 +16,7 @@ from dna.model.DnaMarker import DnaMarker # for isinstance from dna.model.DnaMarker import DnaSegmentMarker # constructor from dna.model.DnaMarker import DnaStrandMarker # constructor -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback class WholeChain(object): """ diff --git a/cad/src/dna/operations/crossovers.py b/cad/src/dna/operations/crossovers.py index a3f96c2aa..268408169 100755 --- a/cad/src/dna/operations/crossovers.py +++ b/cad/src/dna/operations/crossovers.py @@ -16,7 +16,7 @@ TODO: make it work for PAM3 as well as PAM5. # - Pl position is wrong after either op, esp. Remove # - Undo and Feature Help cmdnames are wrong (not working) -from constants import noop, average_value +from utilities.constants import noop, average_value from model.bond_constants import V_SINGLE from model.bond_constants import atoms_are_bonded, find_bond from model.bonds import bond_atoms_faster, bond_direction ##, bond_atoms diff --git a/cad/src/dna/temporary_commands/DnaLineMode.py b/cad/src/dna/temporary_commands/DnaLineMode.py index edfcc9c9a..7f9c482e5 100644 --- a/cad/src/dna/temporary_commands/DnaLineMode.py +++ b/cad/src/dna/temporary_commands/DnaLineMode.py @@ -9,12 +9,12 @@ TODO: - User Preferences for different rubberband line display styles """ -from LineMode import LineMode +from temporary_commands.LineMode import LineMode from graphics.drawing.drawDnaLadder import drawDnaLadder from graphics.drawing.drawDnaRibbons import drawDnaRibbons -from constants import black, darkred, blue, white +from utilities.constants import black, darkred, blue, white # == GraphicsMode part diff --git a/cad/src/dna/updater/dna_updater_atoms.py b/cad/src/dna/updater/dna_updater_atoms.py index 003c7834d..a85306572 100644 --- a/cad/src/dna/updater/dna_updater_atoms.py +++ b/cad/src/dna/updater/dna_updater_atoms.py @@ -7,7 +7,7 @@ dna_updater_atoms.py - enforce rules on newly changed PAM atoms and bonds @copyright: 2007-2008 Nanorex, Inc. See LICENSE file for details. """ -from constants import noop as STUB_FUNCTION # FIX all uses +from utilities.constants import noop as STUB_FUNCTION # FIX all uses from dna.updater.dna_updater_globals import get_changes_and_clear from dna.updater.dna_updater_globals import ignore_new_changes diff --git a/cad/src/dna/updater/dna_updater_commands.py b/cad/src/dna/updater/dna_updater_commands.py index 9c45082e0..6fcdbb122 100644 --- a/cad/src/dna/updater/dna_updater_commands.py +++ b/cad/src/dna/updater/dna_updater_commands.py @@ -7,7 +7,7 @@ dna_updater_commands.py - UI commands offered directly by the dna updater. @copyright: 2007-2008 Nanorex, Inc. See LICENSE file for details. """ -from debug import register_debug_menu_command +from utilities.debug import register_debug_menu_command from model.chem import _changed_structure_Atoms # but it's private! refactor sometime diff --git a/cad/src/dna/updater/dna_updater_debug.py b/cad/src/dna/updater/dna_updater_debug.py index c8c9ce472..6ec153c81 100644 --- a/cad/src/dna/updater/dna_updater_debug.py +++ b/cad/src/dna/updater/dna_updater_debug.py @@ -17,11 +17,11 @@ import foundation.env as env from utilities.Log import quote_html -from debug import register_debug_menu_command +from utilities.debug import register_debug_menu_command -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals -from constants import gensym +from utilities.constants import gensym from widgets.simple_dialogs import grab_text_using_dialog diff --git a/cad/src/dna/updater/dna_updater_find_chains.py b/cad/src/dna/updater/dna_updater_find_chains.py index 5374d8de1..0d27a630d 100644 --- a/cad/src/dna/updater/dna_updater_find_chains.py +++ b/cad/src/dna/updater/dna_updater_find_chains.py @@ -9,14 +9,14 @@ dna_updater_find_chains.py - helper for dna_updater_chunks from utilities import debug_flags -from bond_chains import abstract_bond_chain_analyzer +from operations.bond_chains import abstract_bond_chain_analyzer from dna.model.AtomChainOrRing import AtomChain, AtomRing from dna.model.DnaChain import AxisChain, StrandChain from dna.model.DnaChain import DnaChain_AtomChainWrapper # for isinstance -from debug import print_compact_stack +from utilities.debug import print_compact_stack # == diff --git a/cad/src/dna/updater/dna_updater_follow_strand.py b/cad/src/dna/updater/dna_updater_follow_strand.py index fd012968d..c03b722a2 100644 --- a/cad/src/dna/updater/dna_updater_follow_strand.py +++ b/cad/src/dna/updater/dna_updater_follow_strand.py @@ -7,7 +7,7 @@ dna_updater_follow_strand.py - helper function for dna_updater_ladders. @copyright: 2007-2008 Nanorex, Inc. See LICENSE file for details. """ -from constants import noop +from utilities.constants import noop _FAKE_AXIS_FOR_BARE_STRANDS = [1] # arbitrary non-false object comparable using 'is' diff --git a/cad/src/dna/updater/dna_updater_globals.py b/cad/src/dna/updater/dna_updater_globals.py index 0f3b0585f..b32c04cdf 100644 --- a/cad/src/dna/updater/dna_updater_globals.py +++ b/cad/src/dna/updater/dna_updater_globals.py @@ -15,7 +15,7 @@ from foundation.changedicts import _cdproc_for_dictid # but it's private! from model.chem import _changed_structure_Atoms, _changed_parent_Atoms # but they're private! refactor sometime -from debug import print_compact_stack +from utilities.debug import print_compact_stack _DEBUG_ATOM_KEY = None # None, or a value of atom.key for which all ignored changes should be printed diff --git a/cad/src/dna/updater/dna_updater_prefs.py b/cad/src/dna/updater/dna_updater_prefs.py index 6c3c4bc85..bd098d2a8 100644 --- a/cad/src/dna/updater/dna_updater_prefs.py +++ b/cad/src/dna/updater/dna_updater_prefs.py @@ -7,8 +7,8 @@ dna_updater_prefs.py - access to preferences settings affecting the dna updater @copyright: 2007-2008 Nanorex, Inc. See LICENSE file for details. """ -from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False -from debug_prefs import Choice +from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False +from utilities.debug_prefs import Choice import foundation.env as env diff --git a/cad/src/dna/updater/fix_bond_directions.py b/cad/src/dna/updater/fix_bond_directions.py index 271d1099c..d5822b942 100644 --- a/cad/src/dna/updater/fix_bond_directions.py +++ b/cad/src/dna/updater/fix_bond_directions.py @@ -11,7 +11,7 @@ from model.elements import Singlet import foundation.env as env from utilities.Log import orangemsg -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals from dna.updater.dna_updater_prefs import pref_print_bond_direction_errors diff --git a/cad/src/dna/updater/fix_deprecated_elements.py b/cad/src/dna/updater/fix_deprecated_elements.py index 56eadef18..641f7e19c 100644 --- a/cad/src/dna/updater/fix_deprecated_elements.py +++ b/cad/src/dna/updater/fix_deprecated_elements.py @@ -9,7 +9,7 @@ fix_deprecated_elements.py - fix deprecated PAM elements in-place in models from model.elements import PeriodicTable -from constants import diDEFAULT +from utilities.constants import diDEFAULT from utilities import debug_flags diff --git a/cad/src/exprs/Arrow.py b/cad/src/exprs/Arrow.py index b65c056d2..eb298ad1e 100644 --- a/cad/src/exprs/Arrow.py +++ b/cad/src/exprs/Arrow.py @@ -12,7 +12,7 @@ from exprs.widget2d import Widget2D from exprs.attr_decl_macros import ArgOrOption from exprs.ExprsConstants import Color, Position, ORIGIN, DX -from constants import gray +from utilities.constants import gray from graphics.drawing.drawer import drawDirectionArrow diff --git a/cad/src/exprs/Boxed.py b/cad/src/exprs/Boxed.py index 53a64786d..1143148b2 100755 --- a/cad/src/exprs/Boxed.py +++ b/cad/src/exprs/Boxed.py @@ -10,7 +10,7 @@ See also: DraggablyBoxed """ -from constants import white +from utilities.constants import white from exprs.Rect import RectFrame from exprs.Overlay import Overlay diff --git a/cad/src/exprs/DisplayListChunk.py b/cad/src/exprs/DisplayListChunk.py index b85695a3f..f592fb295 100755 --- a/cad/src/exprs/DisplayListChunk.py +++ b/cad/src/exprs/DisplayListChunk.py @@ -50,9 +50,9 @@ just pointers to the draw-method-owning parents in each one, to be stored in the from OpenGL.GL import GL_COMPILE -from debug_prefs import Choice_boolean_False -from debug_prefs import debug_pref -from debug import print_compact_traceback +from utilities.debug_prefs import Choice_boolean_False +from utilities.debug_prefs import debug_pref +from utilities.debug import print_compact_traceback from foundation.changes import SelfUsageTrackingMixin # defines track_use, track_inval; maintains a private __subslist on self from foundation.changes import SubUsageTrackingMixin # defines begin_tracking_usage, end_tracking_usage; doesn't use self diff --git a/cad/src/exprs/DraggableHandle.py b/cad/src/exprs/DraggableHandle.py index 4e3884351..6fb7557ce 100644 --- a/cad/src/exprs/DraggableHandle.py +++ b/cad/src/exprs/DraggableHandle.py @@ -11,7 +11,7 @@ to avoid confusion with the DragHandler API (which would otherwise differ by only the final 'r'). """ -from constants import white +from utilities.constants import white from exprs.attr_decl_macros import Instance, Option from exprs.transforms import Translate diff --git a/cad/src/exprs/DraggableHandle_AlongCircle.py b/cad/src/exprs/DraggableHandle_AlongCircle.py index 617b12a1a..3bd2be057 100644 --- a/cad/src/exprs/DraggableHandle_AlongCircle.py +++ b/cad/src/exprs/DraggableHandle_AlongCircle.py @@ -3,7 +3,7 @@ $Id$ """ -from constants import white +from utilities.constants import white from exprs.attr_decl_macros import Instance, Option from exprs.transforms import Translate diff --git a/cad/src/exprs/Exprs.py b/cad/src/exprs/Exprs.py index 99a3a5c9c..9cfede9c9 100755 --- a/cad/src/exprs/Exprs.py +++ b/cad/src/exprs/Exprs.py @@ -14,9 +14,9 @@ this file is getting kind of long - maybe split it in some sensible way? # note: this module should not import ExprsMeta, though its InstanceOrExpr subclass needs to (in another module). # instead, it is probably fully imported by ExprsMeta. -from debug import compact_stack -from debug import print_compact_stack -from debug import safe_repr +from utilities.debug import compact_stack +from utilities.debug import print_compact_stack +from utilities.debug import safe_repr ##from debug_prefs import debug_pref, Choice_boolean_False, Choice_boolean_True, Choice diff --git a/cad/src/exprs/ExprsConstants.py b/cad/src/exprs/ExprsConstants.py index da7165330..10a01c726 100644 --- a/cad/src/exprs/ExprsConstants.py +++ b/cad/src/exprs/ExprsConstants.py @@ -15,10 +15,10 @@ from geometry.VQT import V # compass positions, also usable for DrawInCorner -from prefs_constants import UPPER_RIGHT -from prefs_constants import UPPER_LEFT -from prefs_constants import LOWER_LEFT -from prefs_constants import LOWER_RIGHT +from utilities.prefs_constants import UPPER_RIGHT +from utilities.prefs_constants import UPPER_LEFT +from utilities.prefs_constants import LOWER_LEFT +from utilities.prefs_constants import LOWER_RIGHT # note: their values are ints -- perhaps hard to change since they might correspond to Qt radiobutton indices (guess) @@ -63,12 +63,12 @@ nevermind = lambda func: identity #e maybe import the following from a different file, but for now we need to define some here #k need to make sure none of these are defined elsewhere in this module -from constants import red, green, blue, white +from utilities.constants import red, green, blue, white ##from constants import black, purple, magenta, violet, yellow, orange, pink, gray # note: various defs of purple I've seen: # ave_colors( 0.5, red, blue), or (0.5, 0.0, 0.5), or (0.7,0.0,0.7), or (0.6, 0.1, 0.9) == violet in constants.py ##from constants import aqua, darkgreen, navy, darkred, lightblue -from constants import ave_colors +from utilities.constants import ave_colors ###e what does this do to alpha? A: uses zip, which means, weight it if present in both colors, discard it otherwise. ###k What *should* it do? Not that, but that is at least not going to cause "crashes" in non-alpha-using code. diff --git a/cad/src/exprs/ExprsMeta.py b/cad/src/exprs/ExprsMeta.py index 6a702c3bb..68c19a29b 100755 --- a/cad/src/exprs/ExprsMeta.py +++ b/cad/src/exprs/ExprsMeta.py @@ -138,9 +138,9 @@ from idlelib.Delegator import Delegator # from modules in cad/src -from constants import remove_prefix +from utilities.constants import remove_prefix ##from env import seen_before -from debug import print_compact_traceback, print_compact_stack +from utilities.debug import print_compact_traceback, print_compact_stack # from this exprs package in cad/src diff --git a/cad/src/exprs/Highlightable.py b/cad/src/exprs/Highlightable.py index d4879334e..1cd7de050 100755 --- a/cad/src/exprs/Highlightable.py +++ b/cad/src/exprs/Highlightable.py @@ -45,9 +45,9 @@ from utilities import debug_flags from geometry.VQT import A from geometry.VQT import vlen from geometry.VQT import V -from constants import noop -from constants import green -from debug import print_compact_traceback +from utilities.constants import noop +from utilities.constants import green +from utilities.debug import print_compact_traceback from exprs.Exprs import or_Expr, canon_expr from exprs.Exprs import printfunc diff --git a/cad/src/exprs/If_expr.py b/cad/src/exprs/If_expr.py index 841c36bfb..e62f1aef6 100755 --- a/cad/src/exprs/If_expr.py +++ b/cad/src/exprs/If_expr.py @@ -12,7 +12,7 @@ but for now, it has to be in this separate file (maybe that's best anyway). Note: file needs cleanup, and code needs reimplem. """ -from debug import print_compact_stack +from utilities.debug import print_compact_stack from exprs.Exprs import OpExpr, canon_expr, expr_constant_value from exprs.instance_helpers import InstanceMacro diff --git a/cad/src/exprs/IorE_guest_mixin.py b/cad/src/exprs/IorE_guest_mixin.py index ef79a7c7f..871b9e163 100644 --- a/cad/src/exprs/IorE_guest_mixin.py +++ b/cad/src/exprs/IorE_guest_mixin.py @@ -14,8 +14,8 @@ from exprs.lvals import call_but_discard_tracked_usage from exprs.widget_env import thisname_of_class, widget_env -from debug import safe_repr -from debug import print_compact_stack +from utilities.debug import safe_repr +from utilities.debug import print_compact_stack from exprs.Exprs import Expr from exprs.Exprs import is_pure_expr diff --git a/cad/src/exprs/Rect.py b/cad/src/exprs/Rect.py index 09a3af289..c2f743ef9 100755 --- a/cad/src/exprs/Rect.py +++ b/cad/src/exprs/Rect.py @@ -21,7 +21,7 @@ from OpenGL.GLU import gluPartialDisk from utilities import debug_flags -from constants import gray, white, black +from utilities.constants import gray, white, black from exprs.widget2d import Widget2D from exprs.attr_decl_macros import Arg, ArgOrOption, Option diff --git a/cad/src/exprs/controls.py b/cad/src/exprs/controls.py index 193f386a4..206e0e7bb 100755 --- a/cad/src/exprs/controls.py +++ b/cad/src/exprs/controls.py @@ -50,9 +50,9 @@ from exprs.staterefs import LocalVariable_StateRef ###e move to basic, if it doe ##from exprs.debug_exprs import debug_evals_of_Expr -from constants import gray, blue, yellow, orange -from debug_prefs import debug_pref -from debug_prefs import Choice_boolean_False +from utilities.constants import gray, blue, yellow, orange +from utilities.debug_prefs import debug_pref +from utilities.debug_prefs import Choice_boolean_False from exprs.widget2d import Widget2D from exprs.Exprs import format_Expr, eq_Expr, not_Expr, call_Expr, or_Expr diff --git a/cad/src/exprs/debug_exprs.py b/cad/src/exprs/debug_exprs.py index 4f3108a2a..e691ff069 100755 --- a/cad/src/exprs/debug_exprs.py +++ b/cad/src/exprs/debug_exprs.py @@ -5,8 +5,8 @@ $Id$ # == local imports with reload -from debug import safe_repr -from debug import print_compact_stack +from utilities.debug import safe_repr +from utilities.debug import print_compact_stack from exprs.Exprs import internal_Expr ###k probably not needed (imported by basic) but needs test diff --git a/cad/src/exprs/demo_MT.py b/cad/src/exprs/demo_MT.py index 2271799b4..ee0f8265e 100755 --- a/cad/src/exprs/demo_MT.py +++ b/cad/src/exprs/demo_MT.py @@ -117,10 +117,10 @@ nfrs: # == imports -from constants import blue, green, ave_colors, white +from utilities.constants import blue, green, ave_colors, white -from debug import print_compact_traceback -from debug import safe_repr +from utilities.debug import print_compact_traceback +from utilities.debug import safe_repr from exprs.Highlightable import Highlightable from exprs.TextRect import TextRect diff --git a/cad/src/exprs/demo_drag.py b/cad/src/exprs/demo_drag.py index 8cce80809..48c616674 100755 --- a/cad/src/exprs/demo_drag.py +++ b/cad/src/exprs/demo_drag.py @@ -54,12 +54,12 @@ from exprs.DisplayListChunk import DisplayListChunk from exprs.world import World -from constants import black, noop -from constants import red -from constants import blue -from constants import green -from constants import white -from constants import yellow +from utilities.constants import black, noop +from utilities.constants import red +from utilities.constants import blue +from utilities.constants import green +from utilities.constants import white +from utilities.constants import yellow from exprs.Exprs import list_Expr, eval_Expr, call_Expr from exprs.Exprs import mod_Expr diff --git a/cad/src/exprs/demo_draw_on_surface.py b/cad/src/exprs/demo_draw_on_surface.py index 66fa3b513..46d07afb7 100755 --- a/cad/src/exprs/demo_draw_on_surface.py +++ b/cad/src/exprs/demo_draw_on_surface.py @@ -21,7 +21,7 @@ from OpenGL.GL import GL_LINE_STRIP from OpenGL.GL import glVertex3fv from OpenGL.GL import glEnd -from constants import yellow, purple, red, noop +from utilities.constants import yellow, purple, red, noop from widgets.simple_dialogs import grab_text_using_dialog diff --git a/cad/src/exprs/demo_polyline.py b/cad/src/exprs/demo_polyline.py index df83c4ee4..85f6e7e50 100755 --- a/cad/src/exprs/demo_polyline.py +++ b/cad/src/exprs/demo_polyline.py @@ -33,7 +33,7 @@ from OpenGL.GL import GL_LINE_STRIP from OpenGL.GL import glVertex3fv from OpenGL.GL import glEnd -from constants import blue, noop +from utilities.constants import blue, noop from exprs.Exprs import list_Expr, call_Expr from exprs.instance_helpers import DelegatingInstanceOrExpr, ModelObject diff --git a/cad/src/exprs/demo_ui.py b/cad/src/exprs/demo_ui.py index 0abdce27c..9eee86d46 100755 --- a/cad/src/exprs/demo_ui.py +++ b/cad/src/exprs/demo_ui.py @@ -11,8 +11,8 @@ from exprs.toolbars import MainToolbar from exprs.command_registry import find_or_make_global_command_registry -from constants import pink -from prefs_constants import UPPER_LEFT, UPPER_RIGHT +from utilities.constants import pink +from utilities.prefs_constants import UPPER_LEFT, UPPER_RIGHT from exprs.Exprs import list_Expr from exprs.If_expr import If diff --git a/cad/src/exprs/dna_ribbon_view.py b/cad/src/exprs/dna_ribbon_view.py index c94e68d88..79cceffc3 100755 --- a/cad/src/exprs/dna_ribbon_view.py +++ b/cad/src/exprs/dna_ribbon_view.py @@ -129,10 +129,10 @@ from exprs.pallettes import PalletteWell from geometry.VQT import norm -from constants import gray, black, red, blue, purple, white -from constants import ave_colors, noop -from constants import green -from constants import yellow +from utilities.constants import gray, black, red, blue, purple, white +from utilities.constants import ave_colors, noop +from utilities.constants import green +from utilities.constants import yellow from exprs.widget2d import Widget, Stub from exprs.Exprs import norm_Expr, vlen_Expr, int_Expr, call_Expr, getattr_Expr, format_Expr diff --git a/cad/src/exprs/draggable.py b/cad/src/exprs/draggable.py index 31a57300c..710cc36e4 100755 --- a/cad/src/exprs/draggable.py +++ b/cad/src/exprs/draggable.py @@ -70,7 +70,7 @@ from geometry.VQT import V, Q from geometry.VQT import norm from geometry.VQT import cross from geometry.VQT import vlen -from constants import blue, white, ave_colors +from utilities.constants import blue, white, ave_colors from exprs.Exprs import call_Expr, LvalueFromObjAndAttr, format_Expr, V_expr, neg_Expr from exprs.Boxed import Boxed diff --git a/cad/src/exprs/images.py b/cad/src/exprs/images.py index c0ce395f0..a8511c7aa 100755 --- a/cad/src/exprs/images.py +++ b/cad/src/exprs/images.py @@ -99,7 +99,7 @@ import graphics.drawing.texture_helpers as texture_helpers # function create_PIL_image_obj_from_image_file, a trivial glue function into ImageUtils.py class nEImageOps, # function loadTexture. -from icon_utilities import image_directory # for finding texture & cursor files +from utilities.icon_utilities import image_directory # for finding texture & cursor files # last-resort image file (same image file is used in other modules, but for different purposes) courierfile = os.path.join( image_directory(), "ui/exprs/text/courier-128.png") ### TODO: RENAME @@ -254,13 +254,13 @@ def canon_image_filename( filename): ## #stub, might work for now: ## thisdir = os.path.dirname(__file__) # dir of exprs module ## CAD_SRC_PATH = os.path.dirname( thisdir) - from constants import CAD_SRC_PATH + from utilities.constants import CAD_SRC_PATH # [note: in a built Mac release, this might be Contents/Resources/Python/site-packages.zip, or # a related pathname; see comments near its definition.] cad = os.path.dirname( CAD_SRC_PATH) # used below for cad/images # image file path extensively revised 070604, mainly so testmode can work in a built release package - from PlatformDependent import path_of_Nanorex_subdir + from platform.PlatformDependent import path_of_Nanorex_subdir # main exprs-package image directory cad_src_ui_exprs = os.path.join( image_directory(), "ui/exprs") # not necessarily really in cad/src (in a built release) diff --git a/cad/src/exprs/instance_helpers.py b/cad/src/exprs/instance_helpers.py index d5ea24661..dd99d6925 100755 --- a/cad/src/exprs/instance_helpers.py +++ b/cad/src/exprs/instance_helpers.py @@ -17,8 +17,8 @@ from exprs.lvals import LvalError_ValueIsUnset from exprs.widget_env import thisname_of_class, widget_env #e refile import?? or make it an env method?? -from debug import print_compact_traceback -from debug import print_compact_stack +from utilities.debug import print_compact_traceback +from utilities.debug import print_compact_stack from exprs.Exprs import is_pure_expr from exprs.Exprs import is_expr_Instance diff --git a/cad/src/exprs/lvals.py b/cad/src/exprs/lvals.py index 843804ecf..135385991 100755 --- a/cad/src/exprs/lvals.py +++ b/cad/src/exprs/lvals.py @@ -61,7 +61,7 @@ import sys from foundation.changes import SelfUsageTrackingMixin, SubUsageTrackingMixin import foundation.changes as changes -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from utilities.Comparison import same_vals ##from utilities import debug_flags diff --git a/cad/src/exprs/outtakes/basic.py b/cad/src/exprs/outtakes/basic.py index 6235a38c7..b47cfce8e 100755 --- a/cad/src/exprs/outtakes/basic.py +++ b/cad/src/exprs/outtakes/basic.py @@ -48,11 +48,11 @@ from math import pi, sin, cos #070130 from foundation.state_utils import transclose, same_vals ## not yet needed: from state_utils import _UNSET_ # warning: not included in "import *" -from constants import noop # def noop(*args,**kws): pass +from utilities.constants import noop # def noop(*args,**kws): pass -from debug import print_compact_traceback, print_compact_stack, safe_repr +from utilities.debug import print_compact_traceback, print_compact_stack, safe_repr -from debug_prefs import debug_pref, Choice_boolean_False, Choice_boolean_True, Choice #070228 +from utilities.debug_prefs import debug_pref, Choice_boolean_False, Choice_boolean_True, Choice #070228 # consider also doing: import env as global_env [070313 suggestion] diff --git a/cad/src/exprs/pallettes.py b/cad/src/exprs/pallettes.py index 47015a024..6dbca1ebb 100755 --- a/cad/src/exprs/pallettes.py +++ b/cad/src/exprs/pallettes.py @@ -14,7 +14,7 @@ from exprs.Boxed import Boxed from exprs.draggable import DraggableObject -from constants import blue, green +from utilities.constants import blue, green from exprs.Exprs import or_Expr, format_Expr from exprs.instance_helpers import DelegatingInstanceOrExpr diff --git a/cad/src/exprs/projection.py b/cad/src/exprs/projection.py index 8245f9768..b02f0cd16 100755 --- a/cad/src/exprs/projection.py +++ b/cad/src/exprs/projection.py @@ -25,7 +25,7 @@ except: # The installed version of OpenGL requires argument-typed glScale calls. glScale = glScalef -from prefs_constants import UPPER_RIGHT, UPPER_LEFT, LOWER_LEFT, LOWER_RIGHT # note: also in basic.py as of 070302 +from utilities.prefs_constants import UPPER_RIGHT, UPPER_LEFT, LOWER_LEFT, LOWER_RIGHT # note: also in basic.py as of 070302 from exprs.attr_decl_macros import Arg, ArgOrOption, Option from exprs.instance_helpers import DelegatingInstanceOrExpr diff --git a/cad/src/exprs/reload.py b/cad/src/exprs/reload.py index 2b993e38b..f5fcfd96e 100644 --- a/cad/src/exprs/reload.py +++ b/cad/src/exprs/reload.py @@ -9,8 +9,8 @@ Note: as of 070921 reload_once is no longer called except in testdraw.py. """ from utilities import debug_flags -import EndUser -from debug import reload_once_per_event +import utilities.EndUser as EndUser +from utilities.debug import reload_once_per_event ENABLE_RELOAD = True and debug_flags.atom_debug diff --git a/cad/src/exprs/scratch/ModelNode.py b/cad/src/exprs/scratch/ModelNode.py index 99c86596d..b22917f07 100755 --- a/cad/src/exprs/scratch/ModelNode.py +++ b/cad/src/exprs/scratch/ModelNode.py @@ -68,7 +68,7 @@ from exprs.lvals import RecomputingMemoDict ##, call_but_discard_tracked_usage, import foundation.env as env -from constants import gray +from utilities.constants import gray from exprs.instance_helpers import InstanceOrExpr from exprs.attr_decl_macros import StateArg, StateArgOrOption, Arg diff --git a/cad/src/exprs/scratch/PixelTester.py b/cad/src/exprs/scratch/PixelTester.py index 53fdddcf6..bd84b5f85 100755 --- a/cad/src/exprs/scratch/PixelTester.py +++ b/cad/src/exprs/scratch/PixelTester.py @@ -17,7 +17,7 @@ $Id$ #e more imports -from constants import blue, purple +from utilities.constants import blue, purple from exprs.widget2d import Widget2D from exprs.Exprs import format_Expr diff --git a/cad/src/exprs/scratch/test_animation_mode.py b/cad/src/exprs/scratch/test_animation_mode.py index b3330d4fb..391ad2058 100644 --- a/cad/src/exprs/scratch/test_animation_mode.py +++ b/cad/src/exprs/scratch/test_animation_mode.py @@ -46,11 +46,11 @@ and a couple more noted on g4: - a few more """ -from prefs_widgets import Preferences_StateRef, Preferences_StateRef_double, ObjAttr_StateRef +from widgets.prefs_widgets import Preferences_StateRef, Preferences_StateRef_double, ObjAttr_StateRef from foundation.changes import Formula ## from test_animation_mode_PM import test_animation_mode_PM -from test_command_PMs import ExampleCommand1_PM +from prototype.test_command_PMs import ExampleCommand1_PM from PM.PM_GroupBox import PM_GroupBox from PM.PM_DoubleSpinBox import PM_DoubleSpinBox from PM.PM_PushButton import PM_PushButton @@ -61,12 +61,12 @@ from PM.PM_CheckBox import PM_CheckBox from command_support.Command import Command from command_support.GraphicsMode import GraphicsMode -from debug import print_compact_traceback, register_debug_menu_command +from utilities.debug import print_compact_traceback, register_debug_menu_command import time, math from foundation.state_utils import copy_val -from constants import green, red, white, pink, black, brown, gray # other colors below +from utilities.constants import green, red, white, pink, black, brown, gray # other colors below from math import pi from graphics.drawing.drawer import drawline, drawbrick, drawsphere, drawcylinder from OpenGL.GL import GL_LIGHTING, glDisable, glEnable @@ -968,7 +968,7 @@ annoyers = [##'editToolbar', 'fileToolbar', 'helpToolbar', 'modifyToolbar', # these imports are not needed in a minimal example like ExampleCommand2; # to make that clear, we put them down here instead of at the top of the file from graphics.drawing.drawer import drawline -from constants import red, green +from utilities.constants import red, green ##from exprs.ExprsConstants import PIXELS from exprs.images import Image ##from exprs.Overlay import Overlay diff --git a/cad/src/exprs/test.py b/cad/src/exprs/test.py index b84d18dac..69a7ac232 100755 --- a/cad/src/exprs/test.py +++ b/cad/src/exprs/test.py @@ -137,12 +137,12 @@ from exprs.test_statearray_3 import test_StateArrayRefs_3 from geometry.VQT import V from utilities.Comparison import same_vals -from constants import purple, white, blue, red, orange, green, lightgreen -from constants import gray, pink, yellow, black -from constants import ave_colors, noop +from utilities.constants import purple, white, blue, red, orange, green, lightgreen +from utilities.constants import gray, pink, yellow, black +from utilities.constants import ave_colors, noop # more colors imported below, from ExprsConstants -from prefs_constants import displayOriginAxis_prefs_key +from utilities.prefs_constants import displayOriginAxis_prefs_key from graphics.drawing.texture_fonts import courierfile from exprs.reload import exprs_globals diff --git a/cad/src/exprs/test_statearray.py b/cad/src/exprs/test_statearray.py index 754b354dd..7722d052c 100755 --- a/cad/src/exprs/test_statearray.py +++ b/cad/src/exprs/test_statearray.py @@ -18,7 +18,7 @@ from exprs.Boxed import Boxed from exprs.Set import Set -from constants import black, pink +from utilities.constants import black, pink from exprs.Exprs import call_Expr from exprs.statearray import StateArrayRefs, StateArrayRefs_getitem_as_stateref diff --git a/cad/src/exprs/test_statearray_3.py b/cad/src/exprs/test_statearray_3.py index 96f89a048..326187092 100644 --- a/cad/src/exprs/test_statearray_3.py +++ b/cad/src/exprs/test_statearray_3.py @@ -36,7 +36,7 @@ from exprs.transforms import Translate from exprs.Overlay import Overlay -from constants import white +from utilities.constants import white from exprs.Exprs import call_Expr, tuple_Expr from exprs.statearray import StateArrayRefs, StateArrayRefs_getitem_as_stateref diff --git a/cad/src/exprs/testdraw.py b/cad/src/exprs/testdraw.py index 0eef5cdc6..e0d1058c3 100755 --- a/cad/src/exprs/testdraw.py +++ b/cad/src/exprs/testdraw.py @@ -83,13 +83,13 @@ from OpenGL.GL import glTranslate import foundation.env as env from utilities import debug_flags -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from constants import ave_colors -from constants import blue -from constants import white -from constants import green -from constants import red +from utilities.constants import ave_colors +from utilities.constants import blue +from utilities.constants import white +from utilities.constants import green +from utilities.constants import red from exprs.reload import exprs_globals #bruce 071102 renamed vv -> exprs_globals and moved it out of this file, diff --git a/cad/src/exprs/testmode.py b/cad/src/exprs/testmode.py index 9b874f10d..29bf65eb1 100755 --- a/cad/src/exprs/testmode.py +++ b/cad/src/exprs/testmode.py @@ -36,10 +36,10 @@ import time from geometry.VQT import V, Q from commands.BuildAtoms.depositMode import depositMode -from debug import print_compact_traceback -from debug_prefs import Choice_boolean_True -from debug_prefs import Choice_boolean_False -from debug_prefs import debug_pref +from utilities.debug import print_compact_traceback +from utilities.debug_prefs import Choice_boolean_True +from utilities.debug_prefs import Choice_boolean_False +from utilities.debug_prefs import debug_pref annoyers = ['editToolbar', 'fileToolbar', 'helpToolbar', 'modifyToolbar', diff --git a/cad/src/exprs/toolbars.py b/cad/src/exprs/toolbars.py index 18e836370..8175162e9 100755 --- a/cad/src/exprs/toolbars.py +++ b/cad/src/exprs/toolbars.py @@ -19,7 +19,7 @@ from exprs.Boxed import Boxed from exprs.command_registry import CommandRegistry -from constants import gray, white, blue, green +from utilities.constants import gray, white, blue, green from exprs.Exprs import list_Expr, format_Expr from exprs.If_expr import If diff --git a/cad/src/extensions.py b/cad/src/extensions.py index 9d6013d36..c8da8688b 100755 --- a/cad/src/extensions.py +++ b/cad/src/extensions.py @@ -75,7 +75,7 @@ have_pyrex_test = False debug_pyrex_test = False ## was debug_flags.atom_debug, changed to 0 for A7 release by bruce 060419 import foundation.env as env -from debug import register_debug_menu_command, call_func_with_timing_histmsg, print_compact_traceback +from utilities.debug import register_debug_menu_command, call_func_with_timing_histmsg, print_compact_traceback # I think it's safe for the following pyrex_test import to be attempted even by # source analysis tools which import single files. Either they'll have diff --git a/cad/src/files/dpb_trajectory/moviefile.py b/cad/src/files/dpb_trajectory/moviefile.py index 691e82732..39e9e8fdc 100755 --- a/cad/src/files/dpb_trajectory/moviefile.py +++ b/cad/src/files/dpb_trajectory/moviefile.py @@ -19,7 +19,7 @@ from struct import unpack # fyi: used for old-format header, no longer for delta ## from VQT import A from Numeric import array, Int8 from utilities import debug_flags -from debug import print_compact_stack, print_compact_traceback +from utilities.debug import print_compact_stack, print_compact_traceback import foundation.env as env def MovieFile(filename): #bruce 050913 removed history arg, since all callers passed env.history diff --git a/cad/src/files/mmp/files_mmp.py b/cad/src/files/mmp/files_mmp.py index 92149ca4b..44553a590 100755 --- a/cad/src/files/mmp/files_mmp.py +++ b/cad/src/files/mmp/files_mmp.py @@ -51,11 +51,11 @@ from foundation.Utility import Node from foundation.Group import Group from model.NamedView import NamedView # for reading one, and for isinstance -from debug import print_compact_traceback -from debug import print_compact_stack +from utilities.debug import print_compact_traceback +from utilities.debug import print_compact_stack -from constants import gensym -from constants import dispNames +from utilities.constants import gensym +from utilities.constants import dispNames from model.bond_constants import find_bond from model.bond_constants import V_SINGLE diff --git a/cad/src/files/mmp/files_mmp_writing.py b/cad/src/files/mmp/files_mmp_writing.py index 6ef0806c9..349963b8d 100755 --- a/cad/src/files/mmp/files_mmp_writing.py +++ b/cad/src/files/mmp/files_mmp_writing.py @@ -115,9 +115,9 @@ MMP_FORMAT_VERSION_TO_WRITE = '050920 required; 080115 preferred' from utilities import debug_flags -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from constants import dispNames +from utilities.constants import dispNames # == diff --git a/cad/src/files/pdb/files_pdb.py b/cad/src/files/pdb/files_pdb.py index a5becce06..27d94d496 100755 --- a/cad/src/files/pdb/files_pdb.py +++ b/cad/src/files/pdb/files_pdb.py @@ -21,13 +21,13 @@ import os, time from model.chunk import Chunk from model.chem import Atom from model.bonds import bond_atoms -from bonds_from_atoms import inferBonds +from operations.bonds_from_atoms import inferBonds from string import capitalize from model.elements import PeriodicTable, Singlet -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals from utilities.Log import redmsg, orangemsg from geometry.VQT import A -from version import Version +from utilities.version import Version from datetime import datetime import foundation.env as env diff --git a/cad/src/foundation/Group.py b/cad/src/foundation/Group.py index c0da09e9f..ea921f56f 100755 --- a/cad/src/foundation/Group.py +++ b/cad/src/foundation/Group.py @@ -18,13 +18,13 @@ split out Node and/or LeafNode as well.) Bruce 080305 changed superclass from Node to NodeWithAtomContents. """ -from debug import print_compact_stack, print_compact_traceback +from utilities.debug import print_compact_stack, print_compact_traceback from utilities import debug_flags import foundation.env as env from foundation.state_constants import S_CHILDREN from commands.GroupProperties.GroupProp import GroupProp -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap from foundation.NodeWithAtomContents import NodeWithAtomContents @@ -548,7 +548,7 @@ class Group(NodeWithAtomContents): # so ob.pick() sees it's picked when its subr scans up the tree for ob in self.members: ob.pick() - from debug_prefs import debug_pref_History_print_every_selected_object + from utilities.debug_prefs import debug_pref_History_print_every_selected_object if debug_pref_History_print_every_selected_object(): #bruce 070504 added this condition # bruce 050131 comment: # I'm very skeptical of doing this history.message diff --git a/cad/src/foundation/Utility.py b/cad/src/foundation/Utility.py index 5e85a2865..d5e941daa 100755 --- a/cad/src/foundation/Utility.py +++ b/cad/src/foundation/Utility.py @@ -28,15 +28,15 @@ Bruce 080305 added some abstract classes between Node and Group in the inheritance hierarchy (defined in this module for now). """ -from debug import print_compact_stack +from utilities.debug import print_compact_stack from utilities import debug_flags import foundation.env as env -from constants import genKey +from utilities.constants import genKey from foundation.state_utils import copy_val, StateMixin, IdentityCopyMixin from utilities.Log import redmsg, orangemsg from foundation.state_constants import S_PARENT, S_DATA, S_CHILD -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap from foundation.Assembly_API import Assembly_API diff --git a/cad/src/foundation/changedicts.py b/cad/src/foundation/changedicts.py index b9faf833e..e365c9f1c 100755 --- a/cad/src/foundation/changedicts.py +++ b/cad/src/foundation/changedicts.py @@ -20,7 +20,7 @@ might be). [bruce 071106 comment] Update 071210: since that comment, it's also been used in the dna updater. """ -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from foundation.changes import register_postinit_item diff --git a/cad/src/foundation/changes.py b/cad/src/foundation/changes.py index a0a34f6ad..473dfba76 100755 --- a/cad/src/foundation/changes.py +++ b/cad/src/foundation/changes.py @@ -22,9 +22,9 @@ bruce 071106 split changedicts.py out of changes.py """ -from debug import print_compact_traceback, print_compact_stack +from utilities.debug import print_compact_traceback, print_compact_stack import foundation.env as env -from constants import noop +from utilities.constants import noop from utilities import debug_flags from utilities.Comparison import same_vals #bruce 060306 diff --git a/cad/src/foundation/inval.py b/cad/src/foundation/inval.py index a3cd45e05..0dae138fb 100755 --- a/cad/src/foundation/inval.py +++ b/cad/src/foundation/inval.py @@ -10,7 +10,7 @@ bruce 050513 replaced some == with 'is' and != with 'is not', to avoid __getattr on __xxx__ attrs in python objects. """ -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback ##from debug import print_compact_stack debug_counter = 0 # uncomment the related code (far below) to find out what's calling our __getattr__ [bruce 050513] diff --git a/cad/src/foundation/preferences.py b/cad/src/foundation/preferences.py index a2610e630..32dc25ae3 100755 --- a/cad/src/foundation/preferences.py +++ b/cad/src/foundation/preferences.py @@ -62,15 +62,15 @@ import os import time from utilities import debug_flags -from PlatformDependent import mkdirs_in_filename -from PlatformDependent import find_or_make_Nanorex_directory +from platform.PlatformDependent import mkdirs_in_filename +from platform.PlatformDependent import find_or_make_Nanorex_directory import foundation.env as env -import EndUser -from debug import print_compact_traceback +import utilities.EndUser as EndUser +from utilities.debug import print_compact_traceback from foundation.changes import UsageTracker -from prefs_constants import prefs_table +from utilities.prefs_constants import prefs_table # some imports remain lower down, for now: bsddb and shelve diff --git a/cad/src/foundation/state_utils.py b/cad/src/foundation/state_utils.py index 2c4a5f4c9..84511fa04 100755 --- a/cad/src/foundation/state_utils.py +++ b/cad/src/foundation/state_utils.py @@ -28,12 +28,12 @@ from foundation.state_constants import ATOM_CHUNK_ATTRIBUTE_NAME from foundation.state_constants import _UNSET_, _Bugval import foundation.env as env -from debug import print_compact_stack +from utilities.debug import print_compact_stack from utilities import debug_flags from utilities.Comparison import same_vals, SAMEVALS_SPEEDUP -from constants import remove_prefix +from utilities.constants import remove_prefix -from GlobalPreferences import debug_pyrex_atoms +from utilities.GlobalPreferences import debug_pyrex_atoms DEBUG_PYREX_ATOMS = debug_pyrex_atoms() @@ -1681,7 +1681,7 @@ class obj_classifier: ## self.kluge_attr2metainfo_from_class[attr] = clas # only for debugging if DEBUG_PYREX_ATOMS: if not env.seen_before("DEBUG_PYREX_ATOMS"): - from GlobalPreferences import usePyrexAtomsAndBonds + from utilities.GlobalPreferences import usePyrexAtomsAndBonds on = usePyrexAtomsAndBonds() print "\nDEBUG_PYREX_ATOMS: Pyrex atoms is", on and "ON" or "OFF" print diff --git a/cad/src/foundation/undo_archive.py b/cad/src/foundation/undo_archive.py index 123b6b324..ec8e38028 100755 --- a/cad/src/foundation/undo_archive.py +++ b/cad/src/foundation/undo_archive.py @@ -15,8 +15,8 @@ providing undo/redo ops which apply those diffs to the model state. import time from utilities import debug_flags -from debug import print_compact_traceback, print_compact_stack, safe_repr -from debug_prefs import debug_pref, Choice_boolean_False, Choice_boolean_True +from utilities.debug import print_compact_traceback, print_compact_stack, safe_repr +from utilities.debug_prefs import debug_pref, Choice_boolean_False, Choice_boolean_True import foundation.env as env import foundation.state_utils as state_utils @@ -27,7 +27,7 @@ from foundation.state_constants import _UNSET_ from foundation.state_constants import UNDO_SPECIALCASE_ATOM, UNDO_SPECIALCASE_BOND from foundation.state_constants import ATOM_CHUNK_ATTRIBUTE_NAME -from prefs_constants import historyMsgSerialNumber_prefs_key +from utilities.prefs_constants import historyMsgSerialNumber_prefs_key from foundation.changes import register_postinit_object import foundation.changedicts as changedicts # warning: very similar to some local variable names @@ -1256,7 +1256,7 @@ def register_undo_updater( func, updates = (), after_update_of = () ): ## print "register_undo_updater ought to register %r but it's nim, or maybe only use of the registration is nim" % func # pseudocode if "pseudocode": - from constants import noop + from utilities.constants import noop somethingYouHaveToDo = progress_marker = canon = this_bfr_that = noop task = somethingYouHaveToDo(func) for name in updates: diff --git a/cad/src/foundation/undo_internals.py b/cad/src/foundation/undo_internals.py index ad209d060..9cb17af54 100755 --- a/cad/src/foundation/undo_internals.py +++ b/cad/src/foundation/undo_internals.py @@ -14,10 +14,10 @@ Module classification: foundation. """ import foundation.env as env -from debug import register_debug_menu_command +from utilities.debug import register_debug_menu_command from PyQt4.Qt import QObject ## , QWidget, SIGNAL from utilities import debug_flags # for atom_debug -import EndUser +import utilities.EndUser as EndUser # debug print options @@ -133,7 +133,7 @@ class wrappedslot: # Print a warning if it looks like the signal and slot argument counts don't match; # if DEBUG_GETARGSPEC then always print something about the analysis result. # Also try to save info on self, so args_info needn't be called at runtime. - from debug import print_compact_traceback + from utilities.debug import print_compact_traceback try: self.args_info_result = args_info(slotboundmethod) success, minargs, maxargs, any_kws_ok = self.args_info_result @@ -244,7 +244,7 @@ class wrappedslot: arglists_to_try.append(( args, kws )) # Retry it with those arglists (zero or more of them to try) worked = False - from debug import print_compact_traceback + from utilities.debug import print_compact_traceback for args, kws in arglists_to_try: try: res = slotboundmethod(*args, **kws) @@ -321,7 +321,7 @@ class wrappedslot: # the leak per-cmenu is smaller than others we have per-user-command. ####@@@@ DOIT if fn: if 1: #experiment 060121 - from debug import print_compact_traceback + from utilities.debug import print_compact_traceback try: win = env.mainwindow() assert win.initialised # make sure it's not too early @@ -697,7 +697,7 @@ def args_info(func1): #bruce 071004 revised implem and return value format # TODO: there might be a smarter wrapper # for that function (which knows about bound methods specifically) # in some other introspection module. - from debug import print_compact_traceback + from utilities.debug import print_compact_traceback try: import inspect try: diff --git a/cad/src/foundation/undo_manager.py b/cad/src/foundation/undo_manager.py index 7d5f04bb1..baafa0f87 100755 --- a/cad/src/foundation/undo_manager.py +++ b/cad/src/foundation/undo_manager.py @@ -12,16 +12,16 @@ into a reasonable form for supporting a UI. [060117 -- for current status see undo_archive.py module docstring] """ -from debug import register_debug_menu_command_maker -from debug import print_compact_traceback, print_compact_stack +from utilities.debug import register_debug_menu_command_maker +from utilities.debug import print_compact_traceback, print_compact_stack from utilities import debug_flags -from PlatformDependent import is_macintosh +from platform.PlatformDependent import is_macintosh from foundation.undo_archive import AssyUndoArchive import foundation.undo_archive as undo_archive # for debug_undo2; # could move that to a debug flags module; not urgent -from constants import noop -from prefs_constants import undoAutomaticCheckpoints_prefs_key +from utilities.constants import noop +from utilities.prefs_constants import undoAutomaticCheckpoints_prefs_key import foundation.env as env from utilities.Log import greenmsg, redmsg ##, orangemsg import time diff --git a/cad/src/foundation/whatsthis_utilities.py b/cad/src/foundation/whatsthis_utilities.py index d2a73aba9..c2c12531c 100755 --- a/cad/src/foundation/whatsthis_utilities.py +++ b/cad/src/foundation/whatsthis_utilities.py @@ -69,7 +69,7 @@ def fix_whatsthis_text_and_links(parent, refix_later = (), debug_cutoff = 0): print "returning immediately (sanity check, bug better be there or"\ "you're insane)" ####@@@@@ yes, bug is not fixed yet return - from PlatformDependent import is_macintosh + from platform.PlatformDependent import is_macintosh mac = is_macintosh() if mac or enable_whatsthis_links: # fix text in 1 or 2 ways for all QAction objects @@ -215,7 +215,7 @@ def refix_whatsthis_text_and_links( ): #bruce 060319 part of fixing bug 1421 ## return import foundation.env as env win = env.mainwindow() - from PlatformDependent import is_macintosh + from platform.PlatformDependent import is_macintosh mac = is_macintosh() fix_QAction_whatsthis(win.editUndoAction, mac) fix_QAction_whatsthis(win.editRedoAction, mac) diff --git a/cad/src/foundation/wiki_help.py b/cad/src/foundation/wiki_help.py index 0832cd048..ed943e521 100755 --- a/cad/src/foundation/wiki_help.py +++ b/cad/src/foundation/wiki_help.py @@ -47,7 +47,7 @@ bruce 051201 made new source file for it, extended it to other kinds of objects from PyQt4 import QtGui from PyQt4.Qt import QDialog from PyQt4.Qt import QTextBrowser -from NE1_QToolBar import NE1_QToolBar +from widgets.NE1_QToolBar import NE1_QToolBar from PyQt4.Qt import QWhatsThisClickedEvent from PyQt4.Qt import QGridLayout @@ -62,10 +62,10 @@ from PyQt4.Qt import SLOT import os import foundation.env as env import webbrowser -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from utilities.Log import redmsg ##from qt4transition import qt4todo -from prefs_constants import wiki_help_prefix_prefs_key +from utilities.prefs_constants import wiki_help_prefix_prefs_key def webbrowser_open(url): if len(webbrowser._tryorder) == 0: diff --git a/cad/src/geometry/BoundingBox.py b/cad/src/geometry/BoundingBox.py index 49a3e6b43..a4efde97e 100644 --- a/cad/src/geometry/BoundingBox.py +++ b/cad/src/geometry/BoundingBox.py @@ -24,7 +24,7 @@ from Numeric import add, subtract, sqrt from Numeric import maximum, minimum, dot
from geometry.VQT import V, A, cat
-from constants import black
+from utilities.constants import black
class BBox:
"""
diff --git a/cad/src/graphics/behaviors/Trackball.py b/cad/src/graphics/behaviors/Trackball.py index 430fc69f9..85cedb8d7 100755 --- a/cad/src/graphics/behaviors/Trackball.py +++ b/cad/src/graphics/behaviors/Trackball.py @@ -13,7 +13,7 @@ Note: bruce 071216 moved class Trackball into its own file, from VQT.py. """ import foundation.env as env -from prefs_constants import mouseSpeedDuringRotation_prefs_key +from utilities.prefs_constants import mouseSpeedDuringRotation_prefs_key from geometry.VQT import Q from geometry.VQT import proj2sphere diff --git a/cad/src/graphics/behaviors/confirmation_corner.py b/cad/src/graphics/behaviors/confirmation_corner.py index ed1db7717..f0d85ac42 100755 --- a/cad/src/graphics/behaviors/confirmation_corner.py +++ b/cad/src/graphics/behaviors/confirmation_corner.py @@ -32,9 +32,9 @@ from exprs.Rect import Rect # needed for Image size option, not just for testing ##from constants import green # only for testing from exprs.projection import DrawInCorner ##, DrawInCorner_projection -from prefs_constants import UPPER_RIGHT +from utilities.prefs_constants import UPPER_RIGHT -from debug import print_compact_traceback ##, print_compact_stack +from utilities.debug import print_compact_traceback ##, print_compact_stack # button region codes (must all be true values; # these are used as indices in various dicts or functions, diff --git a/cad/src/graphics/behaviors/shape.py b/cad/src/graphics/behaviors/shape.py index 007484fcf..4b80a6d68 100755 --- a/cad/src/graphics/behaviors/shape.py +++ b/cad/src/graphics/behaviors/shape.py @@ -35,15 +35,15 @@ from geometry.VQT import A, vlen, V from graphics.drawing.drawer import drawrectangle from graphics.drawing.drawer import drawline -from constants import black -from constants import DELETE_SELECTION -from constants import SUBTRACT_FROM_SELECTION -from constants import ADD_TO_SELECTION -from constants import START_NEW_SELECTION -from constants import white -from constants import red - -from debug import print_compact_traceback +from utilities.constants import black +from utilities.constants import DELETE_SELECTION +from utilities.constants import SUBTRACT_FROM_SELECTION +from utilities.constants import ADD_TO_SELECTION +from utilities.constants import START_NEW_SELECTION +from utilities.constants import white +from utilities.constants import red + +from utilities.debug import print_compact_traceback from utilities import debug_flags from geometry.BoundingBox import BBox diff --git a/cad/src/graphics/display_styles/CylinderChunks.py b/cad/src/graphics/display_styles/CylinderChunks.py index 01c0c506d..ccf337a99 100755 --- a/cad/src/graphics/display_styles/CylinderChunks.py +++ b/cad/src/graphics/display_styles/CylinderChunks.py @@ -17,10 +17,10 @@ import foundation.env as env import graphics.drawing.drawer as drawer from geometry.geometryUtilities import matrix_putting_axis_at_z from geometry.VQT import V, norm -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from graphics.display_styles.displaymodes import ChunkDisplayMode -from constants import ave_colors -from prefs_constants import atomHighlightColor_prefs_key +from utilities.constants import ave_colors +from utilities.prefs_constants import atomHighlightColor_prefs_key chunkHighlightColor_prefs_key = atomHighlightColor_prefs_key # initial kluge diff --git a/cad/src/graphics/display_styles/DnaCylinderChunks.py b/cad/src/graphics/display_styles/DnaCylinderChunks.py index b22cb7d99..2b5771797 100644 --- a/cad/src/graphics/display_styles/DnaCylinderChunks.py +++ b/cad/src/graphics/display_styles/DnaCylinderChunks.py @@ -32,27 +32,27 @@ import foundation.env as env import graphics.drawing.drawer as drawer from geometry.geometryUtilities import matrix_putting_axis_at_z from geometry.VQT import V, norm, cross, angleBetween -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from graphics.display_styles.displaymodes import ChunkDisplayMode -from constants import ave_colors, red, white, darkgreen +from utilities.constants import ave_colors, red, white, darkgreen -from prefs_constants import atomHighlightColor_prefs_key +from utilities.prefs_constants import atomHighlightColor_prefs_key # piotr 080309: user pereferences for DNA style -from prefs_constants import dnaStyleStrandsColor_prefs_key -from prefs_constants import dnaStyleAxisColor_prefs_key -from prefs_constants import dnaStyleStrutsColor_prefs_key -from prefs_constants import dnaStyleBasesColor_prefs_key -from prefs_constants import dnaStyleStrandsShape_prefs_key -from prefs_constants import dnaStyleBasesShape_prefs_key -from prefs_constants import dnaStyleStrandsArrows_prefs_key -from prefs_constants import dnaStyleAxisShape_prefs_key -from prefs_constants import dnaStyleStrutsShape_prefs_key -from prefs_constants import dnaStyleStrandsScale_prefs_key -from prefs_constants import dnaStyleAxisScale_prefs_key -from prefs_constants import dnaStyleBasesScale_prefs_key -from prefs_constants import dnaStyleAxisTaper_prefs_key -from prefs_constants import dnaStyleStrutsScale_prefs_key +from utilities.prefs_constants import dnaStyleStrandsColor_prefs_key +from utilities.prefs_constants import dnaStyleAxisColor_prefs_key +from utilities.prefs_constants import dnaStyleStrutsColor_prefs_key +from utilities.prefs_constants import dnaStyleBasesColor_prefs_key +from utilities.prefs_constants import dnaStyleStrandsShape_prefs_key +from utilities.prefs_constants import dnaStyleBasesShape_prefs_key +from utilities.prefs_constants import dnaStyleStrandsArrows_prefs_key +from utilities.prefs_constants import dnaStyleAxisShape_prefs_key +from utilities.prefs_constants import dnaStyleStrutsShape_prefs_key +from utilities.prefs_constants import dnaStyleStrandsScale_prefs_key +from utilities.prefs_constants import dnaStyleAxisScale_prefs_key +from utilities.prefs_constants import dnaStyleBasesScale_prefs_key +from utilities.prefs_constants import dnaStyleAxisTaper_prefs_key +from utilities.prefs_constants import dnaStyleStrutsScale_prefs_key from model.elements import Singlet from math import sin, cos, pi @@ -586,7 +586,7 @@ class DnaCylinderChunks(ChunkDisplayMode): Draws the chunk that may depend on current view. """ ### drawchunk(self, glpane, chunk, selection_frame_color, memo, highlighted) - from constants import lightgreen + from utilities.constants import lightgreen if 0: if chunk.isStrandChunk(): n_bases = chunk.ladder.baselength() diff --git a/cad/src/graphics/display_styles/SurfaceChunks.py b/cad/src/graphics/display_styles/SurfaceChunks.py index ab1a094e8..ee34d732f 100755 --- a/cad/src/graphics/display_styles/SurfaceChunks.py +++ b/cad/src/graphics/display_styles/SurfaceChunks.py @@ -27,9 +27,9 @@ from geometry.VQT import V, cross from utilities.Log import greenmsg from graphics.display_styles.displaymodes import ChunkDisplayMode -from constants import ave_colors -from constants import diTrueCPK -from prefs_constants import atomHighlightColor_prefs_key +from utilities.constants import ave_colors +from utilities.constants import diTrueCPK +from utilities.prefs_constants import atomHighlightColor_prefs_key _psurface_import_worked = False @@ -589,7 +589,7 @@ class SurfaceChunks(ChunkDisplayMode): rad = sqrt(rad) radius = rad + margin cspheres = [] - from debug_prefs import debug_pref, Choice_boolean_True + from utilities.debug_prefs import debug_pref, Choice_boolean_True use_colors = debug_pref("surface: use colors?", Choice_boolean_True) #bruce 060927 (old code had 0 for use_colors) for i in range(len(spheres)): st = spheres[i] / radius diff --git a/cad/src/graphics/display_styles/displaymodes.py b/cad/src/graphics/display_styles/displaymodes.py index 0963dcf18..490ee35c1 100755 --- a/cad/src/graphics/display_styles/displaymodes.py +++ b/cad/src/graphics/display_styles/displaymodes.py @@ -20,8 +20,8 @@ of our class ChunkDisplayMode. For an example, see CylinderChunks.py. # to make a new display mode for whole chunks, see the instructions in the module docstring above. -import constants -from debug import register_debug_menu_command +import utilities.constants as constants +from utilities.debug import register_debug_menu_command import foundation.env as env _display_mode_handlers = {} # maps disp_name, and also its index in constants.dispNames, to a DisplayMode instance used for drawing @@ -55,7 +55,7 @@ class DisplayMode: self._hide_icon_name = getattr(self, "hide_icon_name", self._icon_name) def get_icon(self, hidden): - from icon_utilities import imagename_to_pixmap + from utilities.icon_utilities import imagename_to_pixmap if hidden: return imagename_to_pixmap( self._hide_icon_name) else: diff --git a/cad/src/graphics/drawables/DirectionArrow.py b/cad/src/graphics/drawables/DirectionArrow.py index e89cc473b..787a59367 100644 --- a/cad/src/graphics/drawables/DirectionArrow.py +++ b/cad/src/graphics/drawables/DirectionArrow.py @@ -27,8 +27,8 @@ from graphics.drawing.drawer import drawDirectionArrow from geometry.VQT import V, norm, vlen from math import pi -from constants import gray, orange -from debug import print_compact_traceback +from utilities.constants import gray, orange +from utilities.debug import print_compact_traceback from graphics.drawables.DragHandler import DragHandler_API from graphics.drawables.Selobj import Selobj_API diff --git a/cad/src/graphics/drawables/ResizeHandle.py b/cad/src/graphics/drawables/ResizeHandle.py index e40949605..d42046e89 100644 --- a/cad/src/graphics/drawables/ResizeHandle.py +++ b/cad/src/graphics/drawables/ResizeHandle.py @@ -22,13 +22,13 @@ from OpenGL.GL import glTranslatef from OpenGL.GL import glRotatef from graphics.drawing.drawer import drawLineLoop, drawPlane -from constants import black, orange, darkgreen +from utilities.constants import black, orange, darkgreen from math import pi from geometry.VQT import V import foundation.env as env -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from graphics.drawables.DragHandler import DragHandler_API from graphics.drawables.Selobj import Selobj_API diff --git a/cad/src/graphics/drawables/RotationHandle.py b/cad/src/graphics/drawables/RotationHandle.py index 7f0652a93..bad754345 100644 --- a/cad/src/graphics/drawables/RotationHandle.py +++ b/cad/src/graphics/drawables/RotationHandle.py @@ -24,7 +24,7 @@ from exprs.ExprsConstants import ORIGIN, DX , DY from exprs.dna_ribbon_view import Cylinder from exprs.Rect import Sphere -from constants import white, yellow, purple, darkgreen +from utilities.constants import white, yellow, purple, darkgreen from geometry.VQT import V from exprs.DraggableHandle_AlongCircle import DraggableHandle_AlongCircle diff --git a/cad/src/graphics/drawables/handles.py b/cad/src/graphics/drawables/handles.py index 065e48f5e..760bf98cd 100755 --- a/cad/src/graphics/drawables/handles.py +++ b/cad/src/graphics/drawables/handles.py @@ -22,9 +22,9 @@ from geometry.VQT import norm from geometry.VQT import orthodist import graphics.drawing.drawer as drawer -from constants import ave_colors -from constants import magenta -from constants import blue +from utilities.constants import ave_colors +from utilities.constants import magenta +from utilities.constants import blue class handleWithHandleSet: """ diff --git a/cad/src/graphics/drawing/Guides.py b/cad/src/graphics/drawing/Guides.py index c84563505..37baeaf3d 100644 --- a/cad/src/graphics/drawing/Guides.py +++ b/cad/src/graphics/drawing/Guides.py @@ -40,17 +40,17 @@ from PyQt4.Qt import QFont, QString, QColor from widgets.widget_helpers import RGBf_to_QColor from geometry.VQT import V -from constants import lightgray, darkgray, black +from utilities.constants import lightgray, darkgray, black -from debug import print_compact_stack +from utilities.debug import print_compact_stack import sys import foundation.env as env -from prefs_constants import displayVertRuler_prefs_key -from prefs_constants import displayHorzRuler_prefs_key -from prefs_constants import rulerPosition_prefs_key -from prefs_constants import rulerColor_prefs_key -from prefs_constants import rulerOpacity_prefs_key +from utilities.prefs_constants import displayVertRuler_prefs_key +from utilities.prefs_constants import displayHorzRuler_prefs_key +from utilities.prefs_constants import rulerPosition_prefs_key +from utilities.prefs_constants import rulerColor_prefs_key +from utilities.prefs_constants import rulerOpacity_prefs_key # These must match the order items appear in the ruler "Position" combobox # in the preferences dialog. diff --git a/cad/src/graphics/drawing/bond_drawer.py b/cad/src/graphics/drawing/bond_drawer.py index fee3d2a93..7e5d52cea 100755 --- a/cad/src/graphics/drawing/bond_drawer.py +++ b/cad/src/graphics/drawing/bond_drawer.py @@ -37,28 +37,28 @@ from graphics.rendering.povray.povheader import povpoint from utilities.Printing import Vector3ToString from model.elements import Singlet -from debug import print_compact_stack, print_compact_traceback - -from constants import diDEFAULT -from constants import diINVISIBLE -from constants import diLINES -from constants import diBALL -from constants import diTUBES -from constants import diTrueCPK -from constants import diDNACYLINDER - -from constants import TubeRadius -from constants import diBALL_SigmaBondRadius -from constants import diDNACYLINDER_SigmaBondRadius - -from constants import ave_colors -from constants import green -from constants import yellow -from constants import red -from constants import blue -from constants import black -from constants import white -from constants import orange +from utilities.debug import print_compact_stack, print_compact_traceback + +from utilities.constants import diDEFAULT +from utilities.constants import diINVISIBLE +from utilities.constants import diLINES +from utilities.constants import diBALL +from utilities.constants import diTUBES +from utilities.constants import diTrueCPK +from utilities.constants import diDNACYLINDER + +from utilities.constants import TubeRadius +from utilities.constants import diBALL_SigmaBondRadius +from utilities.constants import diDNACYLINDER_SigmaBondRadius + +from utilities.constants import ave_colors +from utilities.constants import green +from utilities.constants import yellow +from utilities.constants import red +from utilities.constants import blue +from utilities.constants import black +from utilities.constants import white +from utilities.constants import orange from model.bond_constants import V_SINGLE from model.bond_constants import V_DOUBLE @@ -68,21 +68,21 @@ from model.bond_constants import V_AROMATIC from model.bond_constants import V_GRAPHITE from model.bond_constants import V_CARBOMERIC -from prefs_constants import _default_toolong_hicolor ## not yet in prefs db? -from prefs_constants import diBALL_BondCylinderRadius_prefs_key -from prefs_constants import diDNACYLINDER_BondCylinderRadius_prefs_key -from prefs_constants import pibondLetters_prefs_key -from prefs_constants import pibondStyle_prefs_key -from prefs_constants import arrowsOnFivePrimeEnds_prefs_key -from prefs_constants import arrowsOnThreePrimeEnds_prefs_key -from prefs_constants import arrowsOnBackBones_prefs_key -from prefs_constants import showBondStretchIndicators_prefs_key -from prefs_constants import linesDisplayModeThickness_prefs_key -from prefs_constants import bondStretchColor_prefs_key -from prefs_constants import diBALL_bondcolor_prefs_key -from prefs_constants import dnaStrutScaleFactor_prefs_key - -from GlobalPreferences import disable_do_not_draw_open_bonds +from utilities.prefs_constants import _default_toolong_hicolor ## not yet in prefs db? +from utilities.prefs_constants import diBALL_BondCylinderRadius_prefs_key +from utilities.prefs_constants import diDNACYLINDER_BondCylinderRadius_prefs_key +from utilities.prefs_constants import pibondLetters_prefs_key +from utilities.prefs_constants import pibondStyle_prefs_key +from utilities.prefs_constants import arrowsOnFivePrimeEnds_prefs_key +from utilities.prefs_constants import arrowsOnThreePrimeEnds_prefs_key +from utilities.prefs_constants import arrowsOnBackBones_prefs_key +from utilities.prefs_constants import showBondStretchIndicators_prefs_key +from utilities.prefs_constants import linesDisplayModeThickness_prefs_key +from utilities.prefs_constants import bondStretchColor_prefs_key +from utilities.prefs_constants import diBALL_bondcolor_prefs_key +from utilities.prefs_constants import dnaStrutScaleFactor_prefs_key + +from utilities.GlobalPreferences import disable_do_not_draw_open_bonds # == @@ -523,7 +523,7 @@ def draw_bond_main( self, glpane, disp, col, level, highlighted, povfile = None, if self.v6 != V_SINGLE: if draw_vanes: if debug_flags.atom_debug: - import graphics.drawing.draw_bond_vanes as draw_bond_vanes, debug + import graphics.drawing.draw_bond_vanes as draw_bond_vanes, utilities.debug as debug debug.reload_once_per_event(draw_bond_vanes) #bruce 050825 renabled this, using reload_once_per_event from graphics.drawing.draw_bond_vanes import draw_bond_vanes draw_bond_vanes( self, glpane, sigmabond_cyl_radius, col) # this calls self.get_pi_info() diff --git a/cad/src/graphics/drawing/drawDnaRibbons.py b/cad/src/graphics/drawing/drawDnaRibbons.py index b65b7f8f5..6711eac9e 100755 --- a/cad/src/graphics/drawing/drawDnaRibbons.py +++ b/cad/src/graphics/drawing/drawDnaRibbons.py @@ -32,8 +32,8 @@ from graphics.drawing.drawer import drawPoint from graphics.drawing.drawer import drawsphere from geometry.VQT import norm, vlen, V, cross -from constants import white -from constants import diBALL, diTrueCPK, diTUBES, diLINES +from utilities.constants import white +from utilities.constants import diBALL, diTrueCPK, diTUBES, diLINES #Constants for drawing the ribbon points as spheres. diff --git a/cad/src/graphics/drawing/draw_bond_vanes.py b/cad/src/graphics/drawing/draw_bond_vanes.py index e7726c909..1665a0a22 100755 --- a/cad/src/graphics/drawing/draw_bond_vanes.py +++ b/cad/src/graphics/drawing/draw_bond_vanes.py @@ -34,8 +34,8 @@ from geometry.VQT import cross, vlen, norm import foundation.env as env import graphics.drawing.drawer as drawer -from constants import white -from prefs_constants import pibondStyle_prefs_key +from utilities.constants import white +from utilities.prefs_constants import pibondStyle_prefs_key MAXTWIST = 5 * math.pi / 180 # permissible twist of one vane segment (5 degrees -- just a guess) @@ -68,7 +68,7 @@ def draw_vane( bond, a1p, a2p, ord_pi, rad, col ): If col is not boolean false, use it as the vane color; otherwise, use a constant color which might be influenced by the pi orbital occupancy. """ - from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False ## twisted = debug_pref('pi vanes/ribbons', Choice_boolean_False) pi_bond_style = env.prefs[ pibondStyle_prefs_key] # one of ['multicyl','vane','ribbon'] twisted = (pi_bond_style == 'ribbon') @@ -99,7 +99,7 @@ def draw_vane( bond, a1p, a2p, ord_pi, rad, col ): #bruce 050804: initial test of bond color prefs; inadequate in several ways #######@@@@@@@ from foundation.preferences import prefs_context prefs = prefs_context() - from prefs_constants import bondVaneColor_prefs_key + from utilities.prefs_constants import bondVaneColor_prefs_key color = prefs.get(bondVaneColor_prefs_key) #k I hope this color tuple of floats is in the correct prefs format assert len(color) == 3 # protect following code from color being None (which causes bus error, maybe in PyOpenGL) diff --git a/cad/src/graphics/drawing/draw_grid_lines.py b/cad/src/graphics/drawing/draw_grid_lines.py index 0fe87b2f8..60b7de0d9 100644 --- a/cad/src/graphics/drawing/draw_grid_lines.py +++ b/cad/src/graphics/drawing/draw_grid_lines.py @@ -129,7 +129,7 @@ def drawGPGrid(glpane, color, line_type, w, h, uw, uh, up, right): uw = width spacing between grid lines uh = height spacing between grid lines """ - from prefs_constants import NO_LINE, SOLID_LINE, DASHED_LINE, DOTTED_LINE + from utilities.prefs_constants import NO_LINE, SOLID_LINE, DASHED_LINE, DOTTED_LINE if line_type == NO_LINE: return @@ -229,7 +229,7 @@ def drawSiCGrid(color, line_type, w, h, up, right): """ Draw SiC grid. """ - from prefs_constants import NO_LINE, SOLID_LINE, DASHED_LINE, DOTTED_LINE + from utilities.prefs_constants import NO_LINE, SOLID_LINE, DASHED_LINE, DOTTED_LINE if line_type == NO_LINE: return diff --git a/cad/src/graphics/drawing/drawer.py b/cad/src/graphics/drawing/drawer.py index 541ae8e56..8208838a6 100755 --- a/cad/src/graphics/drawing/drawer.py +++ b/cad/src/graphics/drawing/drawer.py @@ -196,21 +196,21 @@ except: from geometry.VQT import norm, vlen, V, Q, A import foundation.env as env #bruce 051126 -from constants import white, blue, red -from constants import darkgreen, lightblue -from constants import DIAMOND_BOND_LENGTH -from prefs_constants import material_specular_highlights_prefs_key -from prefs_constants import material_specular_shininess_prefs_key -from prefs_constants import material_specular_finish_prefs_key -from prefs_constants import material_specular_brightness_prefs_key +from utilities.constants import white, blue, red +from utilities.constants import darkgreen, lightblue +from utilities.constants import DIAMOND_BOND_LENGTH +from utilities.prefs_constants import material_specular_highlights_prefs_key +from utilities.prefs_constants import material_specular_shininess_prefs_key +from utilities.prefs_constants import material_specular_finish_prefs_key +from utilities.prefs_constants import material_specular_brightness_prefs_key -import debug # for debug.print_compact_traceback +import utilities.debug as debug # for debug.print_compact_traceback # this can't be done at toplevel due to a recursive import issue. # TODO: fix by splitting this module (drawer) into smaller files. ## from Font3D import Font3D -import EndUser +import utilities.EndUser as EndUser # == @@ -911,7 +911,7 @@ def get_gl_info_string(glpane): # grantham 20051129 gl_info_string += 'GL_RENDERER : "%s"\n' % glGetString(GL_RENDERER) gl_info_string += 'GL_EXTENSIONS : "%s"\n' % glGetString(GL_EXTENSIONS) - from debug_prefs import debug_pref, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_False if debug_pref("get_gl_info_string call glAreTexturesResident?", Choice_boolean_False): # Give a practical indication of how much video memory is available. # Should also do this with VBOs. @@ -974,7 +974,7 @@ def drawwiresphere_worker(params): (color, pos, radius, detailLevel) = params ## assert detailLevel == 1 # true, but leave out for speed - from debug_prefs import debug_pref, Choice_boolean_True + from utilities.debug_prefs import debug_pref, Choice_boolean_True newway = debug_pref("new wirespheres?", Choice_boolean_True) #bruce 060415 experiment, re iMac G4 wiresphere bug; fixes it! oldway = not newway # These objects want a constant line color even if they are selected or highlighted. @@ -1794,7 +1794,7 @@ class ColorSorter: Finish sorting - objects recorded since "start" will be sorted and invoked now. """ - from debug_prefs import debug_pref, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_False debug_which_renderer = debug_pref("debug print which renderer", Choice_boolean_False) #bruce 060314, imperfect but tolerable parent_csdl = ColorSorter.parent_csdl @@ -2181,8 +2181,8 @@ def setup_drawer(): glEndList() # Debug Preferences - from debug_prefs import debug_pref, Choice_boolean_True - from debug_prefs import Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_True + from utilities.debug_prefs import Choice_boolean_False choices = [Choice_boolean_False, Choice_boolean_True] # 20060314 grantham @@ -3179,7 +3179,7 @@ def drawFullWindow(vtColors): left-down, right-down, right-up, left-up window corners. To draw the full window, the modelview and projection should be set in identity. """ - from constants import GL_FAR_Z + from utilities.constants import GL_FAR_Z glDisable(GL_LIGHTING) glBegin(GL_QUADS) @@ -3290,7 +3290,7 @@ def renderSurface(surfaceEntities, surfaceNormals): nc = len(surfaceColors) if 1: ### bruce 060927 debug code; when done debugging, we can change them to constants & simplify the code that uses them. - from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False disable_lighting = debug_pref("surface: disable lighting?", Choice_boolean_False) if nc: color_first = debug_pref("surface: color before vertex?", Choice_boolean_True) diff --git a/cad/src/graphics/drawing/texture_fonts.py b/cad/src/graphics/drawing/texture_fonts.py index 94d9bb231..b36eacdcb 100644 --- a/cad/src/graphics/drawing/texture_fonts.py +++ b/cad/src/graphics/drawing/texture_fonts.py @@ -18,7 +18,7 @@ from OpenGL.GLU import gluUnProject import foundation.env as env -from icon_utilities import image_directory # for finding texture files +from utilities.icon_utilities import image_directory # for finding texture files from geometry.VQT import V, A, vlen diff --git a/cad/src/graphics/drawing/texture_helpers.py b/cad/src/graphics/drawing/texture_helpers.py index 7aaddf1f0..c89582f78 100644 --- a/cad/src/graphics/drawing/texture_helpers.py +++ b/cad/src/graphics/drawing/texture_helpers.py @@ -32,8 +32,8 @@ from OpenGL.GL import glTexEnvf from OpenGL.GLU import gluBuild2DMipmaps -from debug_prefs import Choice_boolean_False # in disabled code -from debug_prefs import debug_pref # in disabled code +from utilities.debug_prefs import Choice_boolean_False # in disabled code +from utilities.debug_prefs import debug_pref # in disabled code # note this runtime import below -- TODO, find out if it can be toplevel; # the file it imports is not now [071017] in any import cycles: diff --git a/cad/src/graphics/images/ImageUtils.py b/cad/src/graphics/images/ImageUtils.py index e4835c265..6289010ba 100755 --- a/cad/src/graphics/images/ImageUtils.py +++ b/cad/src/graphics/images/ImageUtils.py @@ -24,7 +24,7 @@ import PngImagePlugin # Don't remove this, it is used by package creator to find PngImagePlugin from utilities import debug_flags #bruce 061127 -from debug import print_compact_traceback #bruce 061128 +from utilities.debug import print_compact_traceback #bruce 061128 class nEImageOps: """ @@ -107,7 +107,7 @@ class nEImageOps: print "debug fyi: nEImageOps.__init__: %r.img.size, mode is %r, %r" % (self, self.img.size, self.img.mode) ### if 1: #bruce 060213 - let debug pref set default values of ideal_width, ideal_height - from debug_prefs import debug_pref, Choice + from utilities.debug_prefs import debug_pref, Choice self.ideal_width = self.ideal_height = debug_pref("image size", Choice([256,128,64,32,512,1024]), prefs_key = 'A8 devel/image size' ) #bruce 060612 made this persistent # these are not used until client code calls getTextureData; @@ -263,7 +263,7 @@ class nEImageOps: # work before or after image is loaded. The docs mentioned elsewhere # are not very clear about this.] import os - from PlatformDependent import find_or_make_Nanorex_subdir + from platform.PlatformDependent import find_or_make_Nanorex_subdir nhdir = find_or_make_Nanorex_subdir("Nano-Hive") basename = os.path.basename(self.imageName) if self._tmpmode: diff --git a/cad/src/graphics/rendering/fileIO.py b/cad/src/graphics/rendering/fileIO.py index ff9c5d88e..cd97e3daf 100755 --- a/cad/src/graphics/rendering/fileIO.py +++ b/cad/src/graphics/rendering/fileIO.py @@ -25,10 +25,10 @@ from graphics.rendering.povray.povheader import povheader, povpoint from graphics.rendering.mdl.mdldata import mdlheader from graphics.rendering.mdl.mdldata import mdlfooter -from constants import diINVISIBLE -from prefs_constants import PERSPECTIVE -from prefs_constants import material_specular_highlights_prefs_key -from prefs_constants import material_specular_finish_prefs_key +from utilities.constants import diINVISIBLE +from utilities.prefs_constants import PERSPECTIVE +from utilities.prefs_constants import material_specular_highlights_prefs_key +from utilities.prefs_constants import material_specular_finish_prefs_key # == diff --git a/cad/src/graphics/rendering/povray/povray.py b/cad/src/graphics/rendering/povray/povray.py index 5cf900b03..ed5971032 100755 --- a/cad/src/graphics/rendering/povray/povray.py +++ b/cad/src/graphics/rendering/povray/povray.py @@ -24,14 +24,14 @@ from PyQt4.Qt import QApplication, QCursor, Qt, QStringList, QProcess, QMessageB import foundation.env as env from utilities.Log import orangemsg ##, redmsg, greenmsg, _graymsg -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from prefs_constants import megapov_enabled_prefs_key -from prefs_constants import megapov_path_prefs_key -from prefs_constants import povray_enabled_prefs_key -from prefs_constants import povray_path_prefs_key -from prefs_constants import povdir_enabled_prefs_key -from prefs_constants import povdir_path_prefs_key +from utilities.prefs_constants import megapov_enabled_prefs_key +from utilities.prefs_constants import megapov_path_prefs_key +from utilities.prefs_constants import povray_enabled_prefs_key +from utilities.prefs_constants import povray_path_prefs_key +from utilities.prefs_constants import povdir_enabled_prefs_key +from utilities.prefs_constants import povdir_path_prefs_key def _dialog_to_offer_prefs_fixup(win, caption, text, macwarning_ok): #bruce 060710 [use Plugin.py instead?] """ @@ -311,7 +311,7 @@ def launch_povray_or_megapov(win, info, povray_ini): #bruce 060707/11 revised th if arg != "": arguments.append(arg) - from Process import Process + from processes.Process import Process p = Process() #bruce 060707: this doesn't take advantage of anything not in QProcess, # unless it matters that it reads and discards stdout/stderr diff --git a/cad/src/graphics/rendering/qutemol/qutemol.py b/cad/src/graphics/rendering/qutemol/qutemol.py index 112c667a4..88191fa88 100755 --- a/cad/src/graphics/rendering/qutemol/qutemol.py +++ b/cad/src/graphics/rendering/qutemol/qutemol.py @@ -25,24 +25,24 @@ import os import sys from PyQt4.Qt import QString, QStringList, QProcess -from prefs_constants import qutemol_enabled_prefs_key, qutemol_path_prefs_key -from debug import print_compact_traceback -from debug_prefs import debug_pref, Choice_boolean_True -from constants import properDisplayNames, TubeRadius, diBALL_SigmaBondRadius +from utilities.prefs_constants import qutemol_enabled_prefs_key, qutemol_path_prefs_key +from utilities.debug import print_compact_traceback +from utilities.debug_prefs import debug_pref, Choice_boolean_True +from utilities.constants import properDisplayNames, TubeRadius, diBALL_SigmaBondRadius from files.pdb.files_pdb import writePDB_Header, writepdb, EXCLUDE_HIDDEN_ATOMS from model.elements import PeriodicTable -from prefs_constants import cpkScaleFactor_prefs_key -from prefs_constants import diBALL_AtomRadius_prefs_key -from prefs_constants import backgroundGradient_prefs_key -from prefs_constants import backgroundColor_prefs_key -from prefs_constants import diBALL_BondCylinderRadius_prefs_key +from utilities.prefs_constants import cpkScaleFactor_prefs_key +from utilities.prefs_constants import diBALL_AtomRadius_prefs_key +from utilities.prefs_constants import backgroundGradient_prefs_key +from utilities.prefs_constants import backgroundColor_prefs_key +from utilities.prefs_constants import diBALL_BondCylinderRadius_prefs_key -from Plugins import checkPluginPreferences +from processes.Plugins import checkPluginPreferences -from Process import Process +from processes.Process import Process from commands.GroupProperties.GroupProp import Statistics -from PlatformDependent import find_or_make_Nanorex_subdir +from platform.PlatformDependent import find_or_make_Nanorex_subdir def launch_qutemol(pdb_file): """ diff --git a/cad/src/graphics/widgets/DynamicTip.py b/cad/src/graphics/widgets/DynamicTip.py index a34765a16..6581dc082 100755 --- a/cad/src/graphics/widgets/DynamicTip.py +++ b/cad/src/graphics/widgets/DynamicTip.py @@ -42,19 +42,19 @@ from model.jigs import Jig from geometry.VQT import vlen from geometry.VQT import atom_angle_radians -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals -from prefs_constants import dynamicToolTipWakeUpDelay_prefs_key -from prefs_constants import dynamicToolTipAtomDistancePrecision_prefs_key -from prefs_constants import dynamicToolTipBendAnglePrecision_prefs_key -from prefs_constants import dynamicToolTipTorsionAnglePrecision_prefs_key -from prefs_constants import dynamicToolTipAtomChunkInfo_prefs_key -from prefs_constants import dynamicToolTipBondChunkInfo_prefs_key -from prefs_constants import dynamicToolTipAtomPosition_prefs_key -from prefs_constants import dynamicToolTipAtomDistanceDeltas_prefs_key -from prefs_constants import dynamicToolTipBondLength_prefs_key -from prefs_constants import dynamicToolTipAtomMass_prefs_key -from prefs_constants import dynamicToolTipVdwRadiiInAtomDistance_prefs_key +from utilities.prefs_constants import dynamicToolTipWakeUpDelay_prefs_key +from utilities.prefs_constants import dynamicToolTipAtomDistancePrecision_prefs_key +from utilities.prefs_constants import dynamicToolTipBendAnglePrecision_prefs_key +from utilities.prefs_constants import dynamicToolTipTorsionAnglePrecision_prefs_key +from utilities.prefs_constants import dynamicToolTipAtomChunkInfo_prefs_key +from utilities.prefs_constants import dynamicToolTipBondChunkInfo_prefs_key +from utilities.prefs_constants import dynamicToolTipAtomPosition_prefs_key +from utilities.prefs_constants import dynamicToolTipAtomDistanceDeltas_prefs_key +from utilities.prefs_constants import dynamicToolTipBondLength_prefs_key +from utilities.prefs_constants import dynamicToolTipAtomMass_prefs_key +from utilities.prefs_constants import dynamicToolTipVdwRadiiInAtomDistance_prefs_key class DynamicTip: # Mark and Ninad 060817. """ diff --git a/cad/src/graphics/widgets/GLPane.py b/cad/src/graphics/widgets/GLPane.py index 69251bc87..87315c574 100755 --- a/cad/src/graphics/widgets/GLPane.py +++ b/cad/src/graphics/widgets/GLPane.py @@ -132,11 +132,11 @@ from commandSequencer.CommandSequencer import modeMixin from utilities import debug_flags from utilities.Log import orangemsg -from PlatformDependent import fix_event_helper -from PlatformDependent import wrap_key_event -from menu_helpers import makemenu_helper -from DebugMenuMixin import DebugMenuMixin -from debug import print_compact_traceback, print_compact_stack +from platform.PlatformDependent import fix_event_helper +from platform.PlatformDependent import wrap_key_event +from widgets.menu_helpers import makemenu_helper +from widgets.DebugMenuMixin import DebugMenuMixin +from utilities.debug import print_compact_traceback, print_compact_stack import foundation.preferences as preferences import foundation.env as env from foundation.changes import SubUsageTrackingMixin @@ -147,43 +147,43 @@ from graphics.drawing.Guides import Guides from foundation.state_utils import transclose -from prefs_constants import glpane_lights_prefs_key -from prefs_constants import compassPosition_prefs_key -from prefs_constants import defaultProjection_prefs_key -from prefs_constants import defaultDisplayMode_prefs_key -from prefs_constants import backgroundColor_prefs_key -from prefs_constants import backgroundGradient_prefs_key -from prefs_constants import animateStandardViews_prefs_key -from prefs_constants import animateMaximumTime_prefs_key -from prefs_constants import light1Color_prefs_key -from prefs_constants import light2Color_prefs_key -from prefs_constants import light3Color_prefs_key -from prefs_constants import displayCompass_prefs_key -from prefs_constants import displayOriginAxis_prefs_key -from prefs_constants import displayOriginAsSmallAxis_prefs_key -from prefs_constants import UPPER_RIGHT -from prefs_constants import UPPER_LEFT -from prefs_constants import LOWER_LEFT -from prefs_constants import displayCompassLabels_prefs_key -from prefs_constants import displayRulers_prefs_key -from prefs_constants import showRulersInPerspectiveView_prefs_key - -from constants import diDEFAULT -from constants import dispLabel -from constants import GL_FAR_Z -from constants import bluesky -from constants import white -from constants import MULTIPANE_GUI - -from debug_prefs import Choice -from debug_prefs import Choice_boolean_False -from debug_prefs import debug_pref - -from GlobalPreferences import DEBUG_BAREMOTION +from utilities.prefs_constants import glpane_lights_prefs_key +from utilities.prefs_constants import compassPosition_prefs_key +from utilities.prefs_constants import defaultProjection_prefs_key +from utilities.prefs_constants import defaultDisplayMode_prefs_key +from utilities.prefs_constants import backgroundColor_prefs_key +from utilities.prefs_constants import backgroundGradient_prefs_key +from utilities.prefs_constants import animateStandardViews_prefs_key +from utilities.prefs_constants import animateMaximumTime_prefs_key +from utilities.prefs_constants import light1Color_prefs_key +from utilities.prefs_constants import light2Color_prefs_key +from utilities.prefs_constants import light3Color_prefs_key +from utilities.prefs_constants import displayCompass_prefs_key +from utilities.prefs_constants import displayOriginAxis_prefs_key +from utilities.prefs_constants import displayOriginAsSmallAxis_prefs_key +from utilities.prefs_constants import UPPER_RIGHT +from utilities.prefs_constants import UPPER_LEFT +from utilities.prefs_constants import LOWER_LEFT +from utilities.prefs_constants import displayCompassLabels_prefs_key +from utilities.prefs_constants import displayRulers_prefs_key +from utilities.prefs_constants import showRulersInPerspectiveView_prefs_key + +from utilities.constants import diDEFAULT +from utilities.constants import dispLabel +from utilities.constants import GL_FAR_Z +from utilities.constants import bluesky +from utilities.constants import white +from utilities.constants import MULTIPANE_GUI + +from utilities.debug_prefs import Choice +from utilities.debug_prefs import Choice_boolean_False +from utilities.debug_prefs import debug_pref + +from utilities.GlobalPreferences import DEBUG_BAREMOTION from graphics.widgets.GLPane_minimal import GLPane_minimal -import qt4transition +import utilities.qt4transition as qt4transition # suspicious imports [should not really be needed, according to bruce 070919] from model.bonds import Bond # used only for selobj ordering @@ -3168,7 +3168,7 @@ class GLPane(GLPane_minimal, modeMixin, DebugMenuMixin, SubUsageTrackingMixin, # draw some test images related to the confirmation corner - from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False ccdp1 = debug_pref("Conf corner test: redraw at lower left", Choice_boolean_False, prefs_key = True) ccdp2 = debug_pref("Conf corner test: redraw in-place", Choice_boolean_False, prefs_key = True) # default changed, same prefs_key diff --git a/cad/src/graphics/widgets/GLPane_minimal.py b/cad/src/graphics/widgets/GLPane_minimal.py index 0ad45b983..373b21607 100644 --- a/cad/src/graphics/widgets/GLPane_minimal.py +++ b/cad/src/graphics/widgets/GLPane_minimal.py @@ -21,12 +21,12 @@ from geometry.VQT import V, Q from graphics.behaviors.Trackball import Trackball from model.NamedView import NamedView -from prefs_constants import undoRestoreView_prefs_key +from utilities.prefs_constants import undoRestoreView_prefs_key -from debug_prefs import Choice -from debug_prefs import debug_pref +from utilities.debug_prefs import Choice +from utilities.debug_prefs import debug_pref -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback import foundation.env as env diff --git a/cad/src/graphics/widgets/ThumbView.py b/cad/src/graphics/widgets/ThumbView.py index e2c7a771e..9a481d307 100755 --- a/cad/src/graphics/widgets/ThumbView.py +++ b/cad/src/graphics/widgets/ThumbView.py @@ -70,20 +70,20 @@ import foundation.env as env from utilities import debug_flags -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from constants import diTrueCPK -from constants import gray -from constants import bluesky -from constants import GL_FAR_Z -from prefs_constants import bondpointHighlightColor_prefs_key +from utilities.constants import diTrueCPK +from utilities.constants import gray +from utilities.constants import bluesky +from utilities.constants import GL_FAR_Z +from utilities.prefs_constants import bondpointHighlightColor_prefs_key from foundation.Group import Group from model.chem import Atom from model.elements import Singlet from model.chunk import Chunk -from pastables import find_hotspot_for_pasting +from operations.pastables import find_hotspot_for_pasting from graphics.widgets.GLPane_minimal import GLPane_minimal @@ -324,7 +324,7 @@ class ThumbView(GLPane_minimal): self.setDepthRange_setup_from_debug_pref() self.setDepthRange_Normal() - from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False if debug_pref("always setup_lighting?", Choice_boolean_False): #bruce 060415 added debug_pref("always setup_lighting?"), in GLPane and ThumbView [KEEP DFLTS THE SAME!!]; # see comments in GLPane diff --git a/cad/src/history/HistoryWidget.py b/cad/src/history/HistoryWidget.py index 80472a81f..bab11123d 100755 --- a/cad/src/history/HistoryWidget.py +++ b/cad/src/history/HistoryWidget.py @@ -31,17 +31,17 @@ from PyQt4.Qt import Qt from PyQt4.Qt import QTextEdit, QTextOption from utilities import debug_flags -from PlatformDependent import mkdirs_in_filename -from DebugMenuMixin import DebugMenuMixin +from platform.PlatformDependent import mkdirs_in_filename +from widgets.DebugMenuMixin import DebugMenuMixin import foundation.env as env -from prefs_constants import historyMsgTimestamp_prefs_key -from prefs_constants import historyMsgSerialNumber_prefs_key -from prefs_constants import historyHeight_prefs_key +from utilities.prefs_constants import historyMsgTimestamp_prefs_key +from utilities.prefs_constants import historyMsgSerialNumber_prefs_key +from utilities.prefs_constants import historyHeight_prefs_key from utilities.Log import graymsg, quote_html, greenmsg, redmsg, orangemsg -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals class message: """ @@ -428,9 +428,9 @@ class HistoryWidget: if not msg: return # now handle the present msg: save (and show transiently) or emit - from debug_prefs import debug_pref, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_False if debug_pref("print history.message() call stacks?", Choice_boolean_False): #bruce 060720 - from debug import compact_stack + from utilities.debug import compact_stack options['compact_stack'] = compact_stack(skip_innermost_n = 2) # skips compact_stack itself, and this line that calls it if transient_id: self.statusbar_msg(msg, repaint = repaint) # (no html allowed in msg!) diff --git a/cad/src/main.py b/cad/src/main.py index b5712e1c6..63ac22df3 100755 --- a/cad/src/main.py +++ b/cad/src/main.py @@ -121,7 +121,7 @@ def _start_NE1(): # NOTE: imports of NE1 source modules MUST NOT BE DONE until after the # optional sys.path change done for _alternateSourcePath, just above. - import EndUser + import utilities.EndUser as EndUser EndUser.setAlternateSourcePath(_alternateSourcePath) diff --git a/cad/src/model/Comment.py b/cad/src/model/Comment.py index 5d925c32d..a4dce62c4 100755 --- a/cad/src/model/Comment.py +++ b/cad/src/model/Comment.py @@ -14,8 +14,8 @@ registering it with files_mmp_registration instead of hardcoding it there """ from foundation.Utility import SimpleCopyMixin, Node -from icon_utilities import imagename_to_pixmap -from constants import gensym +from utilities.icon_utilities import imagename_to_pixmap +from utilities.constants import gensym from files.mmp.files_mmp_registration import MMP_RecordParser from files.mmp.files_mmp_registration import register_MMP_RecordParser diff --git a/cad/src/model/Line.py b/cad/src/model/Line.py index 4c23278b4..45b91aaab 100755 --- a/cad/src/model/Line.py +++ b/cad/src/model/Line.py @@ -20,8 +20,8 @@ from Numeric import dot from math import pi, cos from geometry.VQT import V, Q, cross, A, planeXline, vlen, norm, angleBetween -from debug import print_compact_traceback -from constants import blue +from utilities.debug import print_compact_traceback +from utilities.constants import blue from graphics.drawables.ResizeHandle import ResizeHandle from model.ReferenceGeometry import ReferenceGeometry diff --git a/cad/src/model/NamedView.py b/cad/src/model/NamedView.py index fc1fba58c..21a5e9dee 100644 --- a/cad/src/model/NamedView.py +++ b/cad/src/model/NamedView.py @@ -17,9 +17,9 @@ Mark renamed Csys to NamedView, on or after 2008-02-03. Bruce 080303 simplified NamedView.__init__ arg signature and some calling code. """ -from constants import gensym +from utilities.constants import gensym from geometry.VQT import V, Q, vlen -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap from foundation.Utility import SimpleCopyMixin from foundation.Utility import Node from utilities import debug_flags diff --git a/cad/src/model/Plane.py b/cad/src/model/Plane.py index 0daf13caa..cff5de1be 100755 --- a/cad/src/model/Plane.py +++ b/cad/src/model/Plane.py @@ -25,12 +25,12 @@ from OpenGL.GL import glTranslatef from OpenGL.GL import glRotatef from graphics.drawing.drawer import drawLineLoop, drawPlane -from constants import black, orange, yellow, darkgreen, brown +from utilities.constants import black, orange, yellow, darkgreen, brown from geometry.VQT import V, Q, cross, planeXline, vlen, norm, ptonline from geometry.BoundingBox import BBox -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback import foundation.env as env from utilities.Log import redmsg diff --git a/cad/src/model/PovrayScene.py b/cad/src/model/PovrayScene.py index 69713936c..856056368 100755 --- a/cad/src/model/PovrayScene.py +++ b/cad/src/model/PovrayScene.py @@ -21,13 +21,13 @@ from PyQt4.Qt import QApplication import foundation.env as env from foundation.Utility import SimpleCopyMixin, Node -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap from graphics.rendering.povray.povray import decode_povray_prefs, write_povray_ini_file, launch_povray_or_megapov from graphics.rendering.fileIO import writepovfile from utilities.Log import redmsg, orangemsg, greenmsg, _graymsg from utilities import debug_flags -from PlatformDependent import find_or_make_Nanorex_subdir -from debug import print_compact_traceback +from platform.PlatformDependent import find_or_make_Nanorex_subdir +from utilities.debug import print_compact_traceback import re from files.mmp.files_mmp_registration import MMP_RecordParser diff --git a/cad/src/model/ReferenceGeometry.py b/cad/src/model/ReferenceGeometry.py index 5009f7ead..1f28204da 100755 --- a/cad/src/model/ReferenceGeometry.py +++ b/cad/src/model/ReferenceGeometry.py @@ -29,9 +29,9 @@ some methods in this file have become overdefined. This needs cleanup import foundation.env as env from utilities import debug_flags -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from constants import darkgreen, orange, yellow +from utilities.constants import darkgreen, orange, yellow from OpenGL.GL import glPushName from OpenGL.GL import glPopName diff --git a/cad/src/model/assembly.py b/cad/src/model/assembly.py index 5b3c60d77..7975d153c 100755 --- a/cad/src/model/assembly.py +++ b/cad/src/model/assembly.py @@ -67,24 +67,24 @@ on __xxx__ attrs in python objects. import os import time -import Initialize +import utilities.Initialize as Initialize from foundation.Utility import node_name from foundation.Group import Group -from pastables import is_pastable +from operations.pastables import is_pastable -from debug import print_compact_traceback -from prefs_constants import workingDirectory_prefs_key +from utilities.debug import print_compact_traceback +from utilities.prefs_constants import workingDirectory_prefs_key from utilities.Log import orangemsg ##, greenmsg, redmsg from utilities import debug_flags -from PlatformDependent import find_or_make_any_directory +from platform.PlatformDependent import find_or_make_any_directory import foundation.env as env from foundation.state_utils import StateMixin, IdentityCopyMixin -from debug import print_compact_stack +from utilities.debug import print_compact_stack import foundation.undo_archive as undo_archive -from constants import gensym, SELWHAT_CHUNKS, SELWHAT_ATOMS +from utilities.constants import gensym, SELWHAT_CHUNKS, SELWHAT_ATOMS from foundation.state_constants import S_CHILD, S_DATA, S_REF from model.part import Part as Part_class # use a name we can search for [bruce 071029] @@ -93,7 +93,7 @@ from model.part import Part as Part_class # use a name we can search for [bruce from model.part import MainPart from model.part import ClipboardItemPart -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap from commands.PartProperties.PartProp import PartProp from PyQt4 import QtGui @@ -1590,7 +1590,7 @@ class PartGroup(Group): regularkids = Group.MT_kids(self, display_prefs) if 1 and self.open: #bruce 080306 test code, should clean up - from debug_prefs import debug_pref, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_False want_fake_kid = debug_pref("Model Tree: show fake initial kid?", Choice_boolean_False) have_fake_kid = not not self._initialkids if have_fake_kid and not want_fake_kid: diff --git a/cad/src/model/bond_constants.py b/cad/src/model/bond_constants.py index 8cd424212..45f8f4464 100755 --- a/cad/src/model/bond_constants.py +++ b/cad/src/model/bond_constants.py @@ -23,10 +23,10 @@ as for bond2.] from math import floor, ceil from geometry.VQT import Q -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from utilities import debug_flags import foundation.env as env -from PyrexSimulator import thePyrexSimulator +from simulation.PyrexSimulator import thePyrexSimulator # == diff --git a/cad/src/model/bonds.py b/cad/src/model/bonds.py index 1c474c63b..7181d2f27 100755 --- a/cad/src/model/bonds.py +++ b/cad/src/model/bonds.py @@ -35,8 +35,8 @@ from Numeric import floor from geometry.VQT import Q, vlen, norm -from debug import print_compact_stack, compact_stack, print_compact_traceback -from debug import reload_once_per_event +from utilities.debug import print_compact_stack, compact_stack, print_compact_traceback +from utilities.debug import reload_once_per_event from utilities import debug_flags @@ -52,18 +52,18 @@ from model.bond_constants import bond_type_names from model.bond_constants import atoms_are_bonded from model.bond_constants import find_bond -from bond_chains import grow_directional_bond_chain +from operations.bond_chains import grow_directional_bond_chain import model.global_model_changedicts as global_model_changedicts import foundation.env as env -from GlobalPreferences import usePyrexAtomsAndBonds +from utilities.GlobalPreferences import usePyrexAtomsAndBonds from foundation.state_utils import StateMixin, IdentityCopyMixin from foundation.state_utils import register_instancelike_class from foundation.changedicts import register_changedict, register_class_changedicts -from debug_prefs import debug_pref, Choice_boolean_False +from utilities.debug_prefs import debug_pref, Choice_boolean_False from utilities.Log import redmsg, quote_html from foundation.state_constants import S_CACHE, S_DATA, S_PARENT, UNDO_SPECIALCASE_BOND @@ -1914,9 +1914,9 @@ class Bond(BondBase, StateMixin, Selobj_API, IdentityCopyMixin): to order the atoms in the bond left-to-right (e.g. in text strings). """ if debug_flags.atom_debug: - import bond_utils + import operations.bond_utils as bond_utils reload(bond_utils) # at least during development - from bond_utils import bond_menu_section + from operations.bond_utils import bond_menu_section return bond_menu_section(self, quat = quat) # == diff --git a/cad/src/model/chem.py b/cad/src/model/chem.py index 894b745b3..02ef848e6 100755 --- a/cad/src/model/chem.py +++ b/cad/src/model/chem.py @@ -81,38 +81,38 @@ from geometry.VQT import atom_angle_radians from graphics.rendering.mdl.mdldata import marks, links, filler from graphics.rendering.povray.povheader import povpoint -import debug -from debug import print_compact_stack, print_compact_traceback +import utilities.debug as debug +from utilities.debug import print_compact_stack, print_compact_traceback ##from debug import compact_stack -from debug_prefs import debug_pref, Choice_boolean_False, Choice +from utilities.debug_prefs import debug_pref, Choice_boolean_False, Choice from foundation.changedicts import register_changedict, register_class_changedicts from utilities.Printing import Vector3ToString from utilities.Log import orangemsg, redmsg -from constants import genKey +from utilities.constants import genKey -from constants import diDEFAULT -from constants import diBALL -from constants import diTrueCPK -from constants import diTUBES -from constants import diINVISIBLE +from utilities.constants import diDEFAULT +from utilities.constants import diBALL +from utilities.constants import diTrueCPK +from utilities.constants import diTUBES +from utilities.constants import diINVISIBLE -from constants import ATOM_CONTENT_FOR_DISPLAY_STYLE +from utilities.constants import ATOM_CONTENT_FOR_DISPLAY_STYLE -from constants import dispLabel -from constants import default_display_mode -from constants import TubeRadius +from utilities.constants import dispLabel +from utilities.constants import default_display_mode +from utilities.constants import TubeRadius -from constants import pink -from constants import orange +from utilities.constants import pink +from utilities.constants import orange -from constants import ErrorPickedColor -from constants import PickedColor +from utilities.constants import ErrorPickedColor +from utilities.constants import PickedColor -from GlobalPreferences import disable_do_not_draw_open_bonds -from GlobalPreferences import usePyrexAtomsAndBonds +from utilities.GlobalPreferences import disable_do_not_draw_open_bonds +from utilities.GlobalPreferences import usePyrexAtomsAndBonds from model.bond_constants import V_SINGLE from model.bond_constants import min_max_valences_from_v6 @@ -123,11 +123,11 @@ from model.bond_constants import DIRBOND_CHAIN_END from model.bond_constants import DIRBOND_NONE from model.bond_constants import DIRBOND_ERROR -from prefs_constants import arrowsOnFivePrimeEnds_prefs_key -from prefs_constants import arrowsOnThreePrimeEnds_prefs_key -from prefs_constants import showValenceErrors_prefs_key -from prefs_constants import cpkScaleFactor_prefs_key -from prefs_constants import diBALL_AtomRadius_prefs_key +from utilities.prefs_constants import arrowsOnFivePrimeEnds_prefs_key +from utilities.prefs_constants import arrowsOnThreePrimeEnds_prefs_key +from utilities.prefs_constants import showValenceErrors_prefs_key +from utilities.prefs_constants import cpkScaleFactor_prefs_key +from utilities.prefs_constants import diBALL_AtomRadius_prefs_key from foundation.state_constants import S_CHILDREN, S_PARENT, S_DATA, S_CACHE from foundation.state_constants import UNDO_SPECIALCASE_ATOM, ATOM_CHUNK_ATTRIBUTE_NAME @@ -137,7 +137,7 @@ from graphics.drawables.Selobj import Selobj_API from utilities import debug_flags -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals import foundation.env as env @@ -1374,7 +1374,7 @@ class Atom(AtomBase, InvalMixin, StateMixin, Selobj_API, IdentityCopyMixin): """ assert self._f_draw_bond_geometry_error_indicator_externally # for now assert self.bond_geometry_error_string # make private?? - from constants import ave_colors, red + from utilities.constants import ave_colors, red color = ave_colors(0.5, orange, red) # revise? self.overdraw_with_special_color( color, factor = self._BOND_GEOM_ERROR_RADIUS_MULTIPLIER) @@ -3616,7 +3616,7 @@ class Atom(AtomBase, InvalMixin, StateMixin, Selobj_API, IdentityCopyMixin): @warning: we assume baggage is a subset of self.baggageNeighbors(), but don't check this except when ATOM_DEBUG is set. """ try: - import reposition_baggage + import operations.reposition_baggage as reposition_baggage debug.reload_once_per_event(reposition_baggage) # this can be removed when devel is done, but doesn't need to be reposition_baggage.reposition_baggage_0(self, baggage, planned_atom_nupos) except: diff --git a/cad/src/model/chunk.py b/cad/src/model/chunk.py index 9f7a3d37d..5e97fcd62 100755 --- a/cad/src/model/chunk.py +++ b/cad/src/model/chunk.py @@ -75,14 +75,14 @@ from foundation.NodeWithAtomContents import NodeWithAtomContents from utilities.Log import orangemsg, redmsg, quote_html, graymsg -from debug import print_compact_stack, print_compact_traceback, safe_repr +from utilities.debug import print_compact_stack, print_compact_traceback, safe_repr from foundation.inval import InvalMixin from foundation.changes import SelfUsageTrackingMixin, SubUsageTrackingMixin #bruce 050804, so glpanes can know when they need to redraw a chunk's display list, # and chunks can know when they need to inval that because something drawn into it # would draw differently due to a change in some graphics pref it used -from prefs_constants import bondpointHotspotColor_prefs_key +from utilities.prefs_constants import bondpointHotspotColor_prefs_key import foundation.env as env import graphics.drawing.drawer as drawer from foundation.undo_archive import set_undo_nullMol @@ -94,9 +94,9 @@ from foundation.state_constants import S_REF, S_CHILDREN_NOT_DATA from utilities import debug_flags -from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False +from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap import model.bonds as bonds # TODO: import specific functions, since no longer an import cycle @@ -107,20 +107,20 @@ from graphics.drawing.drawer import ColorSorter, ColorSortedDisplayList ##from drawer import drawlinelist ##from constants import PickedColor -from constants import darkgreen, yellow +from utilities.constants import darkgreen, yellow -from constants import gensym, genKey +from utilities.constants import gensym, genKey -from constants import diDEFAULT -from constants import diINVISIBLE -from constants import diBALL -from constants import diLINES -from constants import diTUBES -from constants import diTrueCPK -from constants import diDNACYLINDER +from utilities.constants import diDEFAULT +from utilities.constants import diINVISIBLE +from utilities.constants import diBALL +from utilities.constants import diLINES +from utilities.constants import diTUBES +from utilities.constants import diTrueCPK +from utilities.constants import diDNACYLINDER -from constants import ATOM_CONTENT_FOR_DISPLAY_STYLE -from constants import noop +from utilities.constants import ATOM_CONTENT_FOR_DISPLAY_STYLE +from utilities.constants import noop from model.elements import PeriodicTable @@ -128,7 +128,7 @@ from commands.ChunkProperties.ChunkProp import ChunkProp from dna.model.Dna_Constants import getComplementSequence -from bond_chains import grow_directional_bond_chain +from operations.bond_chains import grow_directional_bond_chain from graphics.drawing.drawer import apply_material, allow_color_sorting, use_color_sorted_dls @@ -3778,7 +3778,7 @@ def debug_make_BorrowerChunk_raw(do_addmol = True): win.win_update() #k is this done by caller? return -from debug import register_debug_menu_command +from utilities.debug import register_debug_menu_command register_debug_menu_command("make BorrowerChunk", debug_make_BorrowerChunk) register_debug_menu_command("make BorrowerChunk (no addmol)", debug_make_BorrowerChunk_no_addmol) diff --git a/cad/src/model/elements_data.py b/cad/src/model/elements_data.py index 1cc541f80..faeb8f71d 100755 --- a/cad/src/model/elements_data.py +++ b/cad/src/model/elements_data.py @@ -22,7 +22,7 @@ Bruce 071105 revised init code, and split PAM3 and PAM5 data into separate files """ from geometry.VQT import V, A, norm -from constants import DIAMOND_BOND_LENGTH +from utilities.constants import DIAMOND_BOND_LENGTH _DIRECTIONAL_BOND_ELEMENTS_chemical = ('X',) # mark 071014 diff --git a/cad/src/model/jigs.py b/cad/src/model/jigs.py index 13f7265ba..d86321a08 100755 --- a/cad/src/model/jigs.py +++ b/cad/src/model/jigs.py @@ -43,22 +43,22 @@ from OpenGL.GL import GL_FILL from utilities import debug_flags from foundation.Utility import NodeWith3DContents -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap from geometry.VQT import A from commands.ThermostatProperties.StatProp import StatProp from commands.ThermometerProperties.ThermoProp import ThermoProp from utilities.Log import orangemsg from graphics.rendering.povray.povheader import povpoint -from debug import print_compact_stack, print_compact_traceback +from utilities.debug import print_compact_stack, print_compact_traceback import foundation.env as env from graphics.drawing.drawer import drawwirecube -from constants import gensym -from constants import darkgreen -from constants import blue -from constants import darkred -from constants import black +from utilities.constants import gensym +from utilities.constants import darkgreen +from utilities.constants import blue +from utilities.constants import darkred +from utilities.constants import black from foundation.state_constants import S_REFS from graphics.drawables.Selobj import Selobj_API @@ -415,7 +415,7 @@ class Jig(NodeWith3DContents, Selobj_API): [extends superclass method] """ - from debug_prefs import debug_pref_History_print_every_selected_object + from utilities.debug_prefs import debug_pref_History_print_every_selected_object if debug_pref_History_print_every_selected_object(): #bruce 070504 added this condition env.history.message(self.getinfo()) #bruce 050901 revised this; now done even if jig is killed (might affect fixed bug 451-9) diff --git a/cad/src/model/jigs_measurements.py b/cad/src/model/jigs_measurements.py index de90692d6..1d0073381 100755 --- a/cad/src/model/jigs_measurements.py +++ b/cad/src/model/jigs_measurements.py @@ -31,14 +31,14 @@ import foundation.env as env from geometry.VQT import V, norm, cross, vlen, angleBetween from foundation.Utility import Node from utilities.Log import redmsg, greenmsg, orangemsg -from debug import print_compact_stack, print_compact_traceback +from utilities.debug import print_compact_stack, print_compact_traceback from model.jigs import Jig from graphics.drawing.dimensions import drawLinearDimension, drawAngleDimension, drawDihedralDimension from graphics.drawing.drawer import drawtext -from constants import black -from prefs_constants import dynamicToolTipAtomDistancePrecision_prefs_key -from prefs_constants import dynamicToolTipBendAnglePrecision_prefs_key +from utilities.constants import black +from utilities.prefs_constants import dynamicToolTipAtomDistancePrecision_prefs_key +from utilities.prefs_constants import dynamicToolTipBendAnglePrecision_prefs_key def _constrainHandleToAngle(pos, p0, p1, p2): """ diff --git a/cad/src/model/jigs_motors.py b/cad/src/model/jigs_motors.py index eb767108e..78dc6946b 100755 --- a/cad/src/model/jigs_motors.py +++ b/cad/src/model/jigs_motors.py @@ -34,10 +34,10 @@ from graphics.drawing.drawer import drawLinearSign from utilities.Log import orangemsg from utilities.Log import redmsg, greenmsg from graphics.rendering.povray.povheader import povpoint #bruce 050413 -from debug import print_compact_stack, print_compact_traceback +from utilities.debug import print_compact_stack, print_compact_traceback from model.jigs import Jig -from constants import gray +from utilities.constants import gray # == Motors @@ -352,7 +352,7 @@ class RotaryMotor(Motor): def _getToolTipInfo(self): #ninad060825 "Return a string for display in Dynamic Tool tip " - from PlatformDependent import fix_plurals + from platform.PlatformDependent import fix_plurals attachedAtomCount = fix_plurals("Attached to %d atom(s)"%(len(self.atoms))) return str(self.name) + "<br>" + "<font color=\"#0000FF\"> Jig Type:</font>Rotary Motor"\ + "<br>" + "<font color=\"#0000FF\">Torque: </font>" + str(self.torque) + " nN-nm " \ @@ -700,7 +700,7 @@ class LinearMotor(Motor): def _getToolTipInfo(self): #ninad060825 "Return a string for display in Dynamic Tool tip " - from PlatformDependent import fix_plurals + from platform.PlatformDependent import fix_plurals attachedAtomCount = fix_plurals("Attached to %d atom(s)"%(len(self.atoms))) return str(self.name) + "<br>" + "<font color=\"#0000FF\"> Jig Type:</font>Linear Motor"\ + "<br>" + "<font color=\"#0000FF\">Force: </font>" + str(self.force) + " pN " \ diff --git a/cad/src/model/jigs_planes.py b/cad/src/model/jigs_planes.py index db7f34f31..7d33a4e8a 100755 --- a/cad/src/model/jigs_planes.py +++ b/cad/src/model/jigs_planes.py @@ -36,11 +36,11 @@ from graphics.rendering.povray.povheader import povpoint from model.jigs import Jig -from constants import black -from constants import gray +from utilities.constants import black +from utilities.constants import gray -from prefs_constants import SQUARE_GRID -from prefs_constants import SOLID_LINE +from utilities.prefs_constants import SQUARE_GRID +from utilities.prefs_constants import SOLID_LINE from geometry.BoundingBox import BBox diff --git a/cad/src/model/part.py b/cad/src/model/part.py index 5ec0535d9..dae1201c5 100755 --- a/cad/src/model/part.py +++ b/cad/src/model/part.py @@ -54,7 +54,7 @@ from foundation.Assembly_API import Assembly_API from model.NamedView import NamedView from geometry.VQT import V, Q -from debug import print_compact_traceback, print_compact_stack +from utilities.debug import print_compact_traceback, print_compact_stack from utilities import debug_flags from utilities.Log import greenmsg, redmsg @@ -64,24 +64,24 @@ from model.chunk import Chunk from model.jigs import Jig from foundation.node_indices import fix_one_or_complain -from constants import diINVISIBLE +from utilities.constants import diINVISIBLE import foundation.env as env from foundation.inval import InvalMixin from foundation.state_utils import StateMixin, IdentityCopyMixin -from jigmakers_Mixin import jigmakers_Mixin -from ops_atoms import ops_atoms_Mixin -from ops_connected import ops_connected_Mixin -from ops_copy import ops_copy_Mixin -from ops_motion import ops_motion_Mixin -from ops_rechunk import ops_rechunk_Mixin -from ops_select import ops_select_Mixin - -from constants import diDEFAULT -from constants import SELWHAT_CHUNKS, SELWHAT_ATOMS +from operations.jigmakers_Mixin import jigmakers_Mixin +from operations.ops_atoms import ops_atoms_Mixin +from operations.ops_connected import ops_connected_Mixin +from operations.ops_copy import ops_copy_Mixin +from operations.ops_motion import ops_motion_Mixin +from operations.ops_rechunk import ops_rechunk_Mixin +from operations.ops_select import ops_select_Mixin + +from utilities.constants import diDEFAULT +from utilities.constants import SELWHAT_CHUNKS, SELWHAT_ATOMS from foundation.state_constants import S_REF, S_DATA, S_PARENT, S_CHILD -from prefs_constants import levelOfDetail_prefs_key +from utilities.prefs_constants import levelOfDetail_prefs_key from model.Line import Line diff --git a/cad/src/model/pi_bond_sp_chain.py b/cad/src/model/pi_bond_sp_chain.py index 773671633..174f1d729 100755 --- a/cad/src/model/pi_bond_sp_chain.py +++ b/cad/src/model/pi_bond_sp_chain.py @@ -30,7 +30,7 @@ from utilities import debug_flags from model.jigs import Jig from geometry.VQT import V, Q, A, cross, vlen, norm, twistor_angle -from bond_chains import grow_bond_chain +from operations.bond_chains import grow_bond_chain from model.bond_constants import V_SINGLE from model.bond_constants import V_DOUBLE diff --git a/cad/src/model/prefsTree.py b/cad/src/model/prefsTree.py index 307b46be5..41d6f09b9 100755 --- a/cad/src/model/prefsTree.py +++ b/cad/src/model/prefsTree.py @@ -23,7 +23,7 @@ import os from foundation.Utility import Node from foundation.Group import Group from model.part import Part -from constants import noop, dispLabel, default_display_mode +from utilities.constants import noop, dispLabel, default_display_mode import foundation.env as env _debug_prefstree = True # safe for commit even when True @@ -199,7 +199,7 @@ def read_mmp_single_part(assy, filename): # It depends on there being only one active history object at a time. # (Before 050913, that object was stored as both env.history and win.history.) oldmessage = history.message - from constants import noop + from utilities.constants import noop history.message = noop # don't bother user with this file being nonstd (bad, should pass a flag, so other errors seen) try: grouplist = readmmp(assy, filename, isInsert = True) diff --git a/cad/src/modelTree/ModelTree.py b/cad/src/modelTree/ModelTree.py index 71064c299..e3c6d9ca7 100755 --- a/cad/src/modelTree/ModelTree.py +++ b/cad/src/modelTree/ModelTree.py @@ -41,24 +41,24 @@ from PyQt4 import QtCore import foundation.env as env from utilities import debug_flags -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals import modelTree.modelTreeGui as modelTreeGui # defines ModelTreeGui (note case difference), Ne1Model_api from model.chunk import Chunk from model.jigs import Jig from utilities.Log import orangemsg from foundation.Group import Group -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from GlobalPreferences import permit_atom_chunk_coselection +from utilities.GlobalPreferences import permit_atom_chunk_coselection -from constants import gensym -from constants import SELWHAT_ATOMS -from constants import SELWHAT_CHUNKS -from constants import SELWHAT_NAMES -from constants import noop +from utilities.constants import gensym +from utilities.constants import SELWHAT_ATOMS +from utilities.constants import SELWHAT_CHUNKS +from utilities.constants import SELWHAT_NAMES +from utilities.constants import noop -from qt4transition import qt4here +from utilities.qt4transition import qt4here _debug_preftree = False # bruce 050602 experiment; do not commit with True @@ -685,7 +685,7 @@ class modelTree(modelTreeGui.Ne1Model_api): # figure out whether Copy would actually copy anything. part = nodeset[0].part # the same for all nodes in nodeset - from ops_select import selection_from_part + from operations.ops_select import selection_from_part sel = selection_from_part(part, use_selatoms = False) #k should this be the first code to use selection_from_MT() instead? doit = False for node in nodeset: @@ -803,7 +803,7 @@ class modelTree(modelTreeGui.Ne1Model_api): self.assy.Unhide() # includes win_update def cm_set_node(self): #bruce 050604, for debugging - import debug + import utilities.debug as debug nodeset = self.modelTreeGui.topmost_selected_nodes() if len(nodeset) == 1: debug._node = nodeset[0] diff --git a/cad/src/modelTree/Node_as_MT_DND_Target.py b/cad/src/modelTree/Node_as_MT_DND_Target.py index af6e57548..13525800c 100644 --- a/cad/src/modelTree/Node_as_MT_DND_Target.py +++ b/cad/src/modelTree/Node_as_MT_DND_Target.py @@ -30,8 +30,8 @@ described in the bug report. from foundation.Group import Group # for isinstance and for autogrouping; could remove by # asking the assy (and/or the dropped on node) to do the grouping -from ops_copy import copy_nodes_in_order -from ops_copy import copied_nodes_for_DND +from operations.ops_copy import copy_nodes_in_order +from operations.ops_copy import copied_nodes_for_DND import foundation.env as env diff --git a/cad/src/modelTree/modelTreeGui.py b/cad/src/modelTree/modelTreeGui.py index a899e907e..c36ae3420 100755 --- a/cad/src/modelTree/modelTreeGui.py +++ b/cad/src/modelTree/modelTreeGui.py @@ -67,19 +67,19 @@ from PyQt4.Qt import SIGNAL from PyQt4.Qt import QApplication from PyQt4.Qt import QPalette -from debug import print_compact_traceback, print_compact_stack -from PlatformDependent import fix_plurals +from utilities.debug import print_compact_traceback, print_compact_stack +from platform.PlatformDependent import fix_plurals from utilities.Log import quote_html -from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False, Choice -from menu_helpers import makemenu_helper +from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False, Choice +from widgets.menu_helpers import makemenu_helper import foundation.env as env from widgets.simple_dialogs import grab_text_line_using_dialog -from icon_utilities import imagename_to_pixmap +from utilities.icon_utilities import imagename_to_pixmap from modelTree.Node_as_MT_DND_Target import Node_as_MT_DND_Target #bruce 071025 -from constants import AC_INVISIBLE, AC_HAS_INDIVIDUAL_DISPLAY_STYLE +from utilities.constants import AC_INVISIBLE, AC_HAS_INDIVIDUAL_DISPLAY_STYLE DEBUG0 = False # debug api compliance DEBUG = False # debug selection stuff @@ -251,7 +251,7 @@ class Ne1Model_api(Api): [But not including any children of selected nodes. --bruce] """ nodes = [self.get_current_part_topnode()] - from ops_select import topmost_selected_nodes + from operations.ops_select import topmost_selected_nodes return topmost_selected_nodes(nodes) pass # end of class Ne1Model_api @@ -1599,7 +1599,7 @@ class MT_View(QtGui.QWidget): self.modeltreegui.mt_update() def get_icons(self): - from icon_utilities import getpixmap + from utilities.icon_utilities import getpixmap # note: geticon calls QIcon, but painter has no drawIcon, and drawPixmap doesn't accept them, # so here we use getpixmap which calls QPixmap. We could also try QImage and painter.drawImage # (known to work for crate.bmp and other test images, but presumably slower). @@ -1893,7 +1893,7 @@ class ModelTreeGui(QScrollArea, ModelTreeGui_common): self.setWidget(self.view) # Model Tree background color. Mark 2007-06-04 - from prefs_constants import mtColor_prefs_key # In case we want to make it a user pref. + from utilities.prefs_constants import mtColor_prefs_key # In case we want to make it a user pref. from widgets.widget_helpers import RGBf_to_QColor mtColor = RGBf_to_QColor(env.prefs[mtColor_prefs_key]) from PM.PM_Colors import getPalette diff --git a/cad/src/model_updater/bond_updater.py b/cad/src/model_updater/bond_updater.py index 5c7728f18..d6e431c5a 100755 --- a/cad/src/model_updater/bond_updater.py +++ b/cad/src/model_updater/bond_updater.py @@ -25,7 +25,7 @@ part of this into master_model_updater.py, leaving only the bond- type- and atom-type- updating code in this file. """ -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from model.bond_constants import V_SINGLE from model.bond_constants import V_DOUBLE diff --git a/cad/src/model_updater/master_model_updater.py b/cad/src/model_updater/master_model_updater.py index 6da2037d9..8843b895f 100755 --- a/cad/src/model_updater/master_model_updater.py +++ b/cad/src/model_updater/master_model_updater.py @@ -51,7 +51,7 @@ from utilities.Log import redmsg from model_updater.bond_updater import update_bonds_after_each_event from model_updater.bond_updater import process_changed_bond_types -from debug import print_compact_stack, print_compact_traceback +from utilities.debug import print_compact_stack, print_compact_traceback # == @@ -213,7 +213,7 @@ def _autodelete_empty_groups(assy): #bruce 080305 # temporary code for use while developing dna_updater def debug_pref_autodelete_empty_groups(): - from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False res = debug_pref("autodelete empty groups?", ##Choice_boolean_False, #autodelete empty groups by default. This looks safe so far @@ -226,7 +226,7 @@ def debug_pref_autodelete_empty_groups(): return res def debug_pref_use_dna_updater(): - from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False res = debug_pref("DNA: use dna_updater.py?", Choice_boolean_False, ## SOON: Choice_boolean_True, @@ -235,10 +235,10 @@ def debug_pref_use_dna_updater(): return res def debug_pref_reload_dna_updater(): - import EndUser + import utilities.EndUser as EndUser if not EndUser.enableDeveloperFeatures(): return False - from debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_True, Choice_boolean_False res = debug_pref("DNA: auto-reload dna_updater.py?", Choice_boolean_False, ## SOON: Choice_boolean_True, diff --git a/cad/src/ne1_startup/main_startup.py b/cad/src/ne1_startup/main_startup.py index d53c43e23..845305e75 100755 --- a/cad/src/ne1_startup/main_startup.py +++ b/cad/src/ne1_startup/main_startup.py @@ -80,7 +80,7 @@ def startup_script( main_globals): # do some imports used for putting up splashscreen - import icon_utilities + import utilities.icon_utilities as icon_utilities icon_utilities.initialize() @@ -187,7 +187,7 @@ def startup_script( main_globals): #bruce 070515 added condition to disable this on Mac, until Brian fixes the hang on Mac. # Note: this is enabled in the Mac released version, due to a patch during the release # building process, at least in A9.1. - from Sponsors import PermissionDialog + from sponsors.Sponsors import PermissionDialog ## print "start sponsors startup code" # Show the dialog that asks permission to download the sponsor logos, then # launch it as a thread to download and process the logos. diff --git a/cad/src/ne1_startup/startup_before_most_imports.py b/cad/src/ne1_startup/startup_before_most_imports.py index 1be02ee52..29f382b51 100644 --- a/cad/src/ne1_startup/startup_before_most_imports.py +++ b/cad/src/ne1_startup/startup_before_most_imports.py @@ -17,7 +17,7 @@ this new file startup/startup_before_most_imports.py. import sys, os -import EndUser +import utilities.EndUser as EndUser # NOTE: this module (or EndUser) must not do toplevel imports of our other # source modules, because it contains functions which need to be called @@ -34,7 +34,7 @@ def before_most_imports( main_globals ): # gpl_only check at startup [bruce 041217] try: - import gpl_only as _gpl_only + import platform.gpl_only as _gpl_only # if this module is there, this lets it verify it should be there, # and if not, complain (to developers) whenever the program starts print "(running a GPL distribution)" #e retain or zap this? @@ -46,7 +46,7 @@ def before_most_imports( main_globals ): rc = os.path.expanduser(rc) if os.path.exists(rc): ## execfile(rc) -- not allowed! - import debug as _debug + import utilities.debug as _debug _debug.legally_execfile_in_globals(rc, main_globals, error_exception = False) # might fail in non-GPL versions; prints error message but # does not raise an exception. diff --git a/cad/src/ne1_startup/startup_misc.py b/cad/src/ne1_startup/startup_misc.py index 01369ef7d..e3799858c 100755 --- a/cad/src/ne1_startup/startup_misc.py +++ b/cad/src/ne1_startup/startup_misc.py @@ -17,7 +17,7 @@ this new file startup/startup_misc.py. # note: toplevel imports are now ok in this module [bruce 071008 change] -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback def call_module_init_functions(): #bruce 071005 split this out of main_startup.startup_script """ @@ -45,7 +45,7 @@ def call_module_init_functions(): #bruce 071005 split this out of main_startup.s import model.assembly model.assembly.assembly.initialize() - import GroupButtonMixin + import PM.GroupButtonMixin as GroupButtonMixin GroupButtonMixin.GroupButtonMixin.initialize() return @@ -88,7 +88,7 @@ def pre_main_show( win): # screen size even on a very small screen.] # [bruce 050118 further modified this and removed some older comments # (see cvs for those); also split out some code into platform.py.] - from PlatformDependent import screen_pos_size + from platform.PlatformDependent import screen_pos_size ((x0, y0), (screen_w, screen_h)) = screen_pos_size() # note: y0 is nonzero on mac, due to menubar at top of screen. @@ -122,11 +122,11 @@ def pre_main_show( win): # After the above (whose side effects on main window geom. are used as defaults by the following code), # load any mainwindow geometry present in prefs db. [bruce 051218 new feature; see also new "save" features in UserPrefs.py] - from debug import print_compact_stack + from utilities.debug import print_compact_stack try: # this code is similar to debug.py's _debug_load_window_layout from ne1_ui.UserPrefs import load_window_pos_size - from prefs_constants import mainwindow_geometry_prefs_key_prefix + from utilities.prefs_constants import mainwindow_geometry_prefs_key_prefix keyprefix = mainwindow_geometry_prefs_key_prefix load_window_pos_size( win, keyprefix) win._ok_to_autosave_geometry_changes = True @@ -161,7 +161,7 @@ def _initialize_custom_display_modes(win): # diCYLINDER import graphics.display_styles.CylinderChunks as CylinderChunks #bruce 060609 - from debug_prefs import debug_pref, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_False enable_CylinderChunks = debug_pref("enable CylinderChunks next session?", Choice_boolean_False, non_debug = True, @@ -231,7 +231,7 @@ def _init_experimental_commands(): def _init_command_Atom_Generator(): # TODO: this function should be moved into AtomGenerator.py # Atom Generator debug pref. Mark and Jeff. 2007-06-13 - from debug_prefs import debug_pref, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_False from commands.BuildAtom.AtomGenerator import enableAtomGenerator _atomGeneratorIsEnabled = \ debug_pref("Atom Generator example code: enabled?", @@ -244,7 +244,7 @@ def _init_command_Atom_Generator(): def _init_command_Peptide_Generator(): # piotr 080304 # This function enables an experimental peptide generator. - from debug_prefs import debug_pref, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_False from commands.InsertPeptide.PeptideGenerator import enablePeptideGenerator _peptideGeneratorIsEnabled = \ debug_pref("Peptide Generator: enabled?", @@ -259,17 +259,17 @@ def _init_command_Select_Bad_Atoms(): # note: I think this was imported at one point # (which initialized it), and then got left out of the startup code # by mistake for awhile, when init code was revised. [bruce 071008] - import chem_patterns + import operations.chem_patterns as chem_patterns chem_patterns.initialize() return def _init_test_commands(): #bruce 070613 - from debug_prefs import debug_pref, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_False if debug_pref("test_commands enabled (next session)", Choice_boolean_False, prefs_key = True): - import test_commands_init + import prototype.test_commands_init as test_commands_init test_commands_init.initialize() return @@ -312,7 +312,7 @@ def _set_mainwindow_splitter_position( win): # Note: the resize is visible at startup. pw = win.activePartWindow() - from PropMgr_Constants import pmDefaultWidth + from PM.PropMgr_Constants import pmDefaultWidth w1, w2 = pw.pwSplitter.sizes() magic_combined_width = w1 + w2 new_glpane_width = magic_combined_width - pmDefaultWidth diff --git a/cad/src/ne1_ui/MWsemantics.py b/cad/src/ne1_ui/MWsemantics.py index 9fb148f7b..a4381ad71 100755 --- a/cad/src/ne1_ui/MWsemantics.py +++ b/cad/src/ne1_ui/MWsemantics.py @@ -20,7 +20,7 @@ split up the class MWsemantics (as for cookieMode), not just the file.] """ ##from qt4transition import qt4todo -from qt4transition import qt4warning +from utilities.qt4transition import qt4warning from PyQt4 import QtGui, QtCore @@ -49,15 +49,15 @@ import time from utilities import debug_flags -from PlatformDependent import find_or_make_Nanorex_directory +from platform.PlatformDependent import find_or_make_Nanorex_directory ##from PlatformDependent import make_history_filename -from PlatformDependent import open_file_in_editor -from PlatformDependent import find_or_make_Nanorex_subdir +from platform.PlatformDependent import open_file_in_editor +from platform.PlatformDependent import find_or_make_Nanorex_subdir from ne1_ui.ViewOrientationWindow import ViewOrientationWindow # Ninad 061121 -from debug import print_compact_traceback -from debug_prefs import debug_pref, Choice_boolean_False +from utilities.debug import print_compact_traceback +from utilities.debug_prefs import debug_pref, Choice_boolean_False from ne1_ui.Ui_MainWindow import Ui_MainWindow from ne1_ui.Ui_PartWindow import Ui_PartWindow @@ -69,28 +69,28 @@ from utilities.Log import greenmsg, redmsg, orangemsg import ne1_ui.toolbars.Ui_CntFlyout as Ui_CntFlyout import ne1_ui.toolbars.Ui_DnaFlyout as Ui_DnaFlyout -from ops_files import fileSlotsMixin -from ops_view import viewSlotsMixin -from ops_display import displaySlotsMixin -from ops_modify import modifySlotsMixin +from operations.ops_files import fileSlotsMixin +from operations.ops_view import viewSlotsMixin +from operations.ops_display import displaySlotsMixin +from operations.ops_modify import modifySlotsMixin from foundation.changes import register_postinit_object import foundation.preferences as preferences import foundation.env as env import foundation.undo_internals as undo_internals -from prefs_constants import nanohive_enabled_prefs_key -from prefs_constants import gamess_enabled_prefs_key -from prefs_constants import gromacs_enabled_prefs_key -from prefs_constants import cpp_enabled_prefs_key -from prefs_constants import zoomAboutScreenCenter_prefs_key -from prefs_constants import workingDirectory_prefs_key -from prefs_constants import getDefaultWorkingDirectory -from prefs_constants import rememberWinPosSize_prefs_key -from prefs_constants import captionPrefix_prefs_key -from prefs_constants import captionSuffix_prefs_key -from prefs_constants import captionFullPath_prefs_key -from prefs_constants import displayRulers_prefs_key +from utilities.prefs_constants import nanohive_enabled_prefs_key +from utilities.prefs_constants import gamess_enabled_prefs_key +from utilities.prefs_constants import gromacs_enabled_prefs_key +from utilities.prefs_constants import cpp_enabled_prefs_key +from utilities.prefs_constants import zoomAboutScreenCenter_prefs_key +from utilities.prefs_constants import workingDirectory_prefs_key +from utilities.prefs_constants import getDefaultWorkingDirectory +from utilities.prefs_constants import rememberWinPosSize_prefs_key +from utilities.prefs_constants import captionPrefix_prefs_key +from utilities.prefs_constants import captionSuffix_prefs_key +from utilities.prefs_constants import captionFullPath_prefs_key +from utilities.prefs_constants import displayRulers_prefs_key eCCBtab1 = [1,2, 5,6,7,8,9,10, 13,14,15,16,17,18, 32,33,34,35,36, 51,52,53,54] @@ -681,7 +681,7 @@ class MWsemantics(QMainWindow, try: # wware 060406 bug 1263 - signal the simulator that we are exiting # (bruce 070618 moved this here from 3 places in prepareToCloseAndExit.) - from runSim import SimRunner + from simulation.runSim import SimRunner SimRunner.PREPARE_TO_CLOSE = True except: print_compact_traceback( msg ) @@ -830,7 +830,7 @@ class MWsemantics(QMainWindow, Slot for making a checkpoint (only available when Automatic Checkpointing is disabled). """ - import undo_UI + import operations.undo_UI as undo_UI undo_UI.editMakeCheckpoint(self) return @@ -855,7 +855,7 @@ class MWsemantics(QMainWindow, """ Slot for clearing the Undo Stack. Requires the user to confirm. """ - import undo_UI + import operations.undo_UI as undo_UI undo_UI.editClearUndoStack(self) return @@ -1011,7 +1011,7 @@ class MWsemantics(QMainWindow, """ _cmd = greenmsg("Rename: ") - from ops_select import objectSelected, ATOMS, CHUNKS, JIGS + from operations.ops_select import objectSelected, ATOMS, CHUNKS, JIGS if not objectSelected(self.assy, objectFlags = CHUNKS | JIGS): if objectSelected(self.assy, objectFlags = ATOMS): _msg = redmsg("Cannot rename atoms.") @@ -1231,7 +1231,7 @@ class MWsemantics(QMainWindow, """ Displays information about this version of NanoEngineer-1. """ - from version import Version + from utilities.version import Version v = Version() product = v.product versionString = repr(v) + (" (%s)" % v.releaseType) @@ -1321,9 +1321,9 @@ class MWsemantics(QMainWindow, """ if debug_flags.atom_debug: #bruce 060106 added this (fixing trivial bug 1260) print "atom_debug: reloading runSim on each use, for development" - import runSim + import simulation.runSim as runSim reload(runSim) - from runSim import simSetup_CommandRun + from simulation.runSim import simSetup_CommandRun cmdrun = simSetup_CommandRun( self) cmdrun.run() return @@ -1380,7 +1380,7 @@ class MWsemantics(QMainWindow, @note: This is not implemented. """ - from ServerManager import ServerManager + from processes.ServerManager import ServerManager ServerManager().showDialog() ################################### diff --git a/cad/src/ne1_ui/Ui_MainWindow.py b/cad/src/ne1_ui/Ui_MainWindow.py index 2149e7f4f..f65123710 100755 --- a/cad/src/ne1_ui/Ui_MainWindow.py +++ b/cad/src/ne1_ui/Ui_MainWindow.py @@ -8,7 +8,7 @@ $Id$ from PyQt4 import QtCore, QtGui from PyQt4.Qt import Qt, QWidget, QVBoxLayout -from icon_utilities import geticon +from utilities.icon_utilities import geticon import ne1_ui.Ui_MainWindowWidgets as Ui_MainWindowWidgets import ne1_ui.Ui_MainWindowWidgetConnections as Ui_MainWindowWidgetConnections @@ -32,7 +32,7 @@ import ne1_ui.toolbars.Ui_BuildToolsToolBar as Ui_BuildToolsToolBar import ne1_ui.toolbars.Ui_BuildStructuresToolBar as Ui_BuildStructuresToolBar import ne1_ui.toolbars.Ui_RenderingToolBar as Ui_RenderingToolBar -from StatusBar import StatusBar +from widgets.StatusBar import StatusBar import foundation.env as env @@ -147,7 +147,7 @@ class Ui_MainWindow(object): # I intend to completely remove it soon. Mark 2008-02-29. Ui_BuildStructuresToolBar.setupUi(self, toolbarArea) - from prefs_constants import toolbar_state_prefs_key + from utilities.prefs_constants import toolbar_state_prefs_key # This fixes bug 2482. if not env.prefs[toolbar_state_prefs_key] == 'defaultToolbarState': # Restore the state of the toolbars from the last session. diff --git a/cad/src/ne1_ui/Ui_MainWindowWidgets.py b/cad/src/ne1_ui/Ui_MainWindowWidgets.py index 10c37e267..5b31b24da 100644 --- a/cad/src/ne1_ui/Ui_MainWindowWidgets.py +++ b/cad/src/ne1_ui/Ui_MainWindowWidgets.py @@ -18,8 +18,8 @@ History: import foundation.env as env from PyQt4 import QtGui from PyQt4.Qt import QToolButton -from icon_utilities import geticon -from prefs_constants import displayRulers_prefs_key +from utilities.icon_utilities import geticon +from utilities.prefs_constants import displayRulers_prefs_key def setupUi(win): """ diff --git a/cad/src/ne1_ui/Ui_PartWindow.py b/cad/src/ne1_ui/Ui_PartWindow.py index 4478bb302..8a698bcdc 100755 --- a/cad/src/ne1_ui/Ui_PartWindow.py +++ b/cad/src/ne1_ui/Ui_PartWindow.py @@ -29,15 +29,15 @@ import os from PyQt4.Qt import Qt, QWidget, QFrame, QVBoxLayout, QSplitter from PyQt4.Qt import QTabWidget, QScrollArea, QSizePolicy from graphics.widgets.GLPane import GLPane -from PropMgr_Constants import pmDefaultWidth, pmMaxWidth, pmMinWidth -from icon_utilities import geticon +from PM.PropMgr_Constants import pmDefaultWidth, pmMaxWidth, pmMinWidth +from utilities.icon_utilities import geticon from modelTree.ModelTree import modelTree -from qt4transition import qt4warnDestruction +from utilities.qt4transition import qt4warnDestruction from utilities import debug_flags import foundation.env as env -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback -from prefs_constants import captionFullPath_prefs_key +from utilities.prefs_constants import captionFullPath_prefs_key class _pwProjectTabWidget(QTabWidget): """ diff --git a/cad/src/ne1_ui/Ui_ReportsDockWidget.py b/cad/src/ne1_ui/Ui_ReportsDockWidget.py index 750cd0658..c422b1d50 100644 --- a/cad/src/ne1_ui/Ui_ReportsDockWidget.py +++ b/cad/src/ne1_ui/Ui_ReportsDockWidget.py @@ -17,9 +17,9 @@ from PyQt4.Qt import Qt, QDockWidget, QWidget, QVBoxLayout, QTabWidget from PyQt4.Qt import QPalette, QSizePolicy from PM.PM_Colors import pmGrpBoxColor from PM.PM_Colors import getPalette -from PlatformDependent import make_history_filename -from qt4transition import qt4todo -from prefs_constants import displayReportsWidget_prefs_key +from platform.PlatformDependent import make_history_filename +from utilities.qt4transition import qt4todo +from utilities.prefs_constants import displayReportsWidget_prefs_key import foundation.env as env class Ui_ReportsDockWidget(QDockWidget): diff --git a/cad/src/ne1_ui/Ui_ViewOrientation.py b/cad/src/ne1_ui/Ui_ViewOrientation.py index 284003e03..498b0c547 100755 --- a/cad/src/ne1_ui/Ui_ViewOrientation.py +++ b/cad/src/ne1_ui/Ui_ViewOrientation.py @@ -5,7 +5,7 @@ $Id$ from PyQt4 import QtCore, QtGui from PyQt4.Qt import Qt -from icon_utilities import geticon +from utilities.icon_utilities import geticon class Ui_ViewOrientation: diff --git a/cad/src/ne1_ui/UserPrefs.py b/cad/src/ne1_ui/UserPrefs.py index 1eba80ee5..e503b27a8 100755 --- a/cad/src/ne1_ui/UserPrefs.py +++ b/cad/src/ne1_ui/UserPrefs.py @@ -35,141 +35,141 @@ from PyQt4.Qt import Qt from UserPrefsDialog import Ui_UserPrefsDialog import foundation.preferences as preferences -from debug import print_compact_traceback -from debug_prefs import debug_pref, Choice_boolean_False +from utilities.debug import print_compact_traceback +from utilities.debug_prefs import debug_pref, Choice_boolean_False import foundation.env as env from widgets.widget_helpers import RGBf_to_QColor, QColor_to_RGBf from widgets.widget_helpers import double_fixup -from prefs_widgets import connect_colorpref_to_colorframe, connect_checkbox_with_boolean_pref +from widgets.prefs_widgets import connect_colorpref_to_colorframe, connect_checkbox_with_boolean_pref from utilities import debug_flags -from PlatformDependent import screen_pos_size -from PlatformDependent import get_rootdir +from platform.PlatformDependent import screen_pos_size +from platform.PlatformDependent import get_rootdir from graphics.rendering.povray.povray import get_default_plugin_path -from icon_utilities import geticon - -from prefs_constants import displayCompass_prefs_key -from prefs_constants import displayCompassLabels_prefs_key -from prefs_constants import displayPOVAxis_prefs_key -from prefs_constants import animateStandardViews_prefs_key -from prefs_constants import displayVertRuler_prefs_key -from prefs_constants import displayHorzRuler_prefs_key -from prefs_constants import rulerPosition_prefs_key -from prefs_constants import rulerColor_prefs_key -from prefs_constants import rulerOpacity_prefs_key -from prefs_constants import showRulersInPerspectiveView_prefs_key -from prefs_constants import Adjust_watchRealtimeMinimization_prefs_key -from prefs_constants import Adjust_minimizationEngine_prefs_key -from prefs_constants import electrostaticsForDnaDuringAdjust_prefs_key -from prefs_constants import Adjust_cutoverRMS_prefs_key -from prefs_constants import qutemol_enabled_prefs_key -from prefs_constants import qutemol_path_prefs_key -from prefs_constants import nanohive_enabled_prefs_key -from prefs_constants import nanohive_path_prefs_key -from prefs_constants import povray_enabled_prefs_key -from prefs_constants import povray_path_prefs_key -from prefs_constants import megapov_enabled_prefs_key -from prefs_constants import megapov_path_prefs_key -from prefs_constants import povdir_enabled_prefs_key -from prefs_constants import gamess_enabled_prefs_key -from prefs_constants import gmspath_prefs_key -from prefs_constants import gromacs_enabled_prefs_key -from prefs_constants import gromacs_path_prefs_key -from prefs_constants import cpp_enabled_prefs_key -from prefs_constants import cpp_path_prefs_key -from prefs_constants import defaultDisplayMode_prefs_key -from prefs_constants import buildModeAutobondEnabled_prefs_key -from prefs_constants import buildModeWaterEnabled_prefs_key -from prefs_constants import buildModeHighlightingEnabled_prefs_key -from prefs_constants import buildModeSelectAtomsOfDepositedObjEnabled_prefs_key -from prefs_constants import light1Color_prefs_key -from prefs_constants import light2Color_prefs_key -from prefs_constants import light3Color_prefs_key -from prefs_constants import atomHighlightColor_prefs_key -from prefs_constants import bondpointHighlightColor_prefs_key -from prefs_constants import levelOfDetail_prefs_key -from prefs_constants import diBALL_AtomRadius_prefs_key -from prefs_constants import cpkScaleFactor_prefs_key -from prefs_constants import showBondStretchIndicators_prefs_key -from prefs_constants import showValenceErrors_prefs_key +from utilities.icon_utilities import geticon + +from utilities.prefs_constants import displayCompass_prefs_key +from utilities.prefs_constants import displayCompassLabels_prefs_key +from utilities.prefs_constants import displayPOVAxis_prefs_key +from utilities.prefs_constants import animateStandardViews_prefs_key +from utilities.prefs_constants import displayVertRuler_prefs_key +from utilities.prefs_constants import displayHorzRuler_prefs_key +from utilities.prefs_constants import rulerPosition_prefs_key +from utilities.prefs_constants import rulerColor_prefs_key +from utilities.prefs_constants import rulerOpacity_prefs_key +from utilities.prefs_constants import showRulersInPerspectiveView_prefs_key +from utilities.prefs_constants import Adjust_watchRealtimeMinimization_prefs_key +from utilities.prefs_constants import Adjust_minimizationEngine_prefs_key +from utilities.prefs_constants import electrostaticsForDnaDuringAdjust_prefs_key +from utilities.prefs_constants import Adjust_cutoverRMS_prefs_key +from utilities.prefs_constants import qutemol_enabled_prefs_key +from utilities.prefs_constants import qutemol_path_prefs_key +from utilities.prefs_constants import nanohive_enabled_prefs_key +from utilities.prefs_constants import nanohive_path_prefs_key +from utilities.prefs_constants import povray_enabled_prefs_key +from utilities.prefs_constants import povray_path_prefs_key +from utilities.prefs_constants import megapov_enabled_prefs_key +from utilities.prefs_constants import megapov_path_prefs_key +from utilities.prefs_constants import povdir_enabled_prefs_key +from utilities.prefs_constants import gamess_enabled_prefs_key +from utilities.prefs_constants import gmspath_prefs_key +from utilities.prefs_constants import gromacs_enabled_prefs_key +from utilities.prefs_constants import gromacs_path_prefs_key +from utilities.prefs_constants import cpp_enabled_prefs_key +from utilities.prefs_constants import cpp_path_prefs_key +from utilities.prefs_constants import defaultDisplayMode_prefs_key +from utilities.prefs_constants import buildModeAutobondEnabled_prefs_key +from utilities.prefs_constants import buildModeWaterEnabled_prefs_key +from utilities.prefs_constants import buildModeHighlightingEnabled_prefs_key +from utilities.prefs_constants import buildModeSelectAtomsOfDepositedObjEnabled_prefs_key +from utilities.prefs_constants import light1Color_prefs_key +from utilities.prefs_constants import light2Color_prefs_key +from utilities.prefs_constants import light3Color_prefs_key +from utilities.prefs_constants import atomHighlightColor_prefs_key +from utilities.prefs_constants import bondpointHighlightColor_prefs_key +from utilities.prefs_constants import levelOfDetail_prefs_key +from utilities.prefs_constants import diBALL_AtomRadius_prefs_key +from utilities.prefs_constants import cpkScaleFactor_prefs_key +from utilities.prefs_constants import showBondStretchIndicators_prefs_key +from utilities.prefs_constants import showValenceErrors_prefs_key # DNA prefs -from prefs_constants import bdnaBasesPerTurn_prefs_key -from prefs_constants import bdnaRise_prefs_key -from prefs_constants import dnaDefaultSegmentColor_prefs_key -from prefs_constants import dnaColorBasesBy_prefs_key -from prefs_constants import dnaStrutScaleFactor_prefs_key -from prefs_constants import arrowsOnBackBones_prefs_key -from prefs_constants import arrowsOnThreePrimeEnds_prefs_key -from prefs_constants import arrowsOnFivePrimeEnds_prefs_key +from utilities.prefs_constants import bdnaBasesPerTurn_prefs_key +from utilities.prefs_constants import bdnaRise_prefs_key +from utilities.prefs_constants import dnaDefaultSegmentColor_prefs_key +from utilities.prefs_constants import dnaColorBasesBy_prefs_key +from utilities.prefs_constants import dnaStrutScaleFactor_prefs_key +from utilities.prefs_constants import arrowsOnBackBones_prefs_key +from utilities.prefs_constants import arrowsOnThreePrimeEnds_prefs_key +from utilities.prefs_constants import arrowsOnFivePrimeEnds_prefs_key # DNA style prefs 080310 piotr -from prefs_constants import dnaStyleStrandsShape_prefs_key -from prefs_constants import dnaStyleStrandsColor_prefs_key -from prefs_constants import dnaStyleStrandsScale_prefs_key -from prefs_constants import dnaStyleStrandsArrows_prefs_key -from prefs_constants import dnaStyleAxisShape_prefs_key -from prefs_constants import dnaStyleAxisColor_prefs_key -from prefs_constants import dnaStyleAxisScale_prefs_key -from prefs_constants import dnaStyleAxisTaper_prefs_key -from prefs_constants import dnaStyleStrutsShape_prefs_key -from prefs_constants import dnaStyleStrutsColor_prefs_key -from prefs_constants import dnaStyleStrutsScale_prefs_key -from prefs_constants import dnaStyleBasesShape_prefs_key -from prefs_constants import dnaStyleBasesColor_prefs_key -from prefs_constants import dnaStyleBasesScale_prefs_key +from utilities.prefs_constants import dnaStyleStrandsShape_prefs_key +from utilities.prefs_constants import dnaStyleStrandsColor_prefs_key +from utilities.prefs_constants import dnaStyleStrandsScale_prefs_key +from utilities.prefs_constants import dnaStyleStrandsArrows_prefs_key +from utilities.prefs_constants import dnaStyleAxisShape_prefs_key +from utilities.prefs_constants import dnaStyleAxisColor_prefs_key +from utilities.prefs_constants import dnaStyleAxisScale_prefs_key +from utilities.prefs_constants import dnaStyleAxisTaper_prefs_key +from utilities.prefs_constants import dnaStyleStrutsShape_prefs_key +from utilities.prefs_constants import dnaStyleStrutsColor_prefs_key +from utilities.prefs_constants import dnaStyleStrutsScale_prefs_key +from utilities.prefs_constants import dnaStyleBasesShape_prefs_key +from utilities.prefs_constants import dnaStyleBasesColor_prefs_key +from utilities.prefs_constants import dnaStyleBasesScale_prefs_key # Undo prefs -from prefs_constants import undoRestoreView_prefs_key -from prefs_constants import undoAutomaticCheckpoints_prefs_key -from prefs_constants import undoStackMemoryLimit_prefs_key -from prefs_constants import historyMsgSerialNumber_prefs_key -from prefs_constants import historyMsgTimestamp_prefs_key -from prefs_constants import historyHeight_prefs_key -from prefs_constants import rememberWinPosSize_prefs_key -from prefs_constants import captionFullPath_prefs_key -from prefs_constants import dynamicToolTipAtomChunkInfo_prefs_key -from prefs_constants import dynamicToolTipAtomMass_prefs_key -from prefs_constants import dynamicToolTipAtomPosition_prefs_key -from prefs_constants import dynamicToolTipAtomDistanceDeltas_prefs_key -from prefs_constants import dynamicToolTipBondLength_prefs_key -from prefs_constants import dynamicToolTipBondChunkInfo_prefs_key -from prefs_constants import dynamicToolTipAtomDistancePrecision_prefs_key -from prefs_constants import captionPrefix_prefs_key -from prefs_constants import captionSuffix_prefs_key -from prefs_constants import compassPosition_prefs_key -from prefs_constants import defaultProjection_prefs_key -from prefs_constants import displayOriginAsSmallAxis_prefs_key -from prefs_constants import displayOriginAxis_prefs_key -from prefs_constants import animateMaximumTime_prefs_key -from prefs_constants import mouseSpeedDuringRotation_prefs_key -from prefs_constants import Adjust_endRMS_prefs_key -from prefs_constants import Adjust_endMax_prefs_key -from prefs_constants import Adjust_cutoverMax_prefs_key -from prefs_constants import zoomAboutScreenCenter_prefs_key -from prefs_constants import sponsor_permanent_permission_prefs_key -from prefs_constants import sponsor_download_permission_prefs_key -from prefs_constants import bondpointHotspotColor_prefs_key -from prefs_constants import diBALL_bondcolor_prefs_key -from prefs_constants import bondHighlightColor_prefs_key -from prefs_constants import bondStretchColor_prefs_key -from prefs_constants import bondVaneColor_prefs_key -from prefs_constants import pibondStyle_prefs_key -from prefs_constants import pibondLetters_prefs_key -from prefs_constants import linesDisplayModeThickness_prefs_key -from prefs_constants import diBALL_BondCylinderRadius_prefs_key -from prefs_constants import startupMode_prefs_key -from prefs_constants import defaultMode_prefs_key -from prefs_constants import material_specular_highlights_prefs_key -from prefs_constants import material_specular_shininess_prefs_key -from prefs_constants import material_specular_brightness_prefs_key -from prefs_constants import material_specular_finish_prefs_key -from prefs_constants import povdir_path_prefs_key -from prefs_constants import dynamicToolTipBendAnglePrecision_prefs_key -from prefs_constants import dynamicToolTipVdwRadiiInAtomDistance_prefs_key -from prefs_constants import displayFontPointSize_prefs_key -from prefs_constants import useSelectedFont_prefs_key -from prefs_constants import displayFont_prefs_key -from prefs_constants import keepBondsDuringTransmute_prefs_key +from utilities.prefs_constants import undoRestoreView_prefs_key +from utilities.prefs_constants import undoAutomaticCheckpoints_prefs_key +from utilities.prefs_constants import undoStackMemoryLimit_prefs_key +from utilities.prefs_constants import historyMsgSerialNumber_prefs_key +from utilities.prefs_constants import historyMsgTimestamp_prefs_key +from utilities.prefs_constants import historyHeight_prefs_key +from utilities.prefs_constants import rememberWinPosSize_prefs_key +from utilities.prefs_constants import captionFullPath_prefs_key +from utilities.prefs_constants import dynamicToolTipAtomChunkInfo_prefs_key +from utilities.prefs_constants import dynamicToolTipAtomMass_prefs_key +from utilities.prefs_constants import dynamicToolTipAtomPosition_prefs_key +from utilities.prefs_constants import dynamicToolTipAtomDistanceDeltas_prefs_key +from utilities.prefs_constants import dynamicToolTipBondLength_prefs_key +from utilities.prefs_constants import dynamicToolTipBondChunkInfo_prefs_key +from utilities.prefs_constants import dynamicToolTipAtomDistancePrecision_prefs_key +from utilities.prefs_constants import captionPrefix_prefs_key +from utilities.prefs_constants import captionSuffix_prefs_key +from utilities.prefs_constants import compassPosition_prefs_key +from utilities.prefs_constants import defaultProjection_prefs_key +from utilities.prefs_constants import displayOriginAsSmallAxis_prefs_key +from utilities.prefs_constants import displayOriginAxis_prefs_key +from utilities.prefs_constants import animateMaximumTime_prefs_key +from utilities.prefs_constants import mouseSpeedDuringRotation_prefs_key +from utilities.prefs_constants import Adjust_endRMS_prefs_key +from utilities.prefs_constants import Adjust_endMax_prefs_key +from utilities.prefs_constants import Adjust_cutoverMax_prefs_key +from utilities.prefs_constants import zoomAboutScreenCenter_prefs_key +from utilities.prefs_constants import sponsor_permanent_permission_prefs_key +from utilities.prefs_constants import sponsor_download_permission_prefs_key +from utilities.prefs_constants import bondpointHotspotColor_prefs_key +from utilities.prefs_constants import diBALL_bondcolor_prefs_key +from utilities.prefs_constants import bondHighlightColor_prefs_key +from utilities.prefs_constants import bondStretchColor_prefs_key +from utilities.prefs_constants import bondVaneColor_prefs_key +from utilities.prefs_constants import pibondStyle_prefs_key +from utilities.prefs_constants import pibondLetters_prefs_key +from utilities.prefs_constants import linesDisplayModeThickness_prefs_key +from utilities.prefs_constants import diBALL_BondCylinderRadius_prefs_key +from utilities.prefs_constants import startupMode_prefs_key +from utilities.prefs_constants import defaultMode_prefs_key +from utilities.prefs_constants import material_specular_highlights_prefs_key +from utilities.prefs_constants import material_specular_shininess_prefs_key +from utilities.prefs_constants import material_specular_brightness_prefs_key +from utilities.prefs_constants import material_specular_finish_prefs_key +from utilities.prefs_constants import povdir_path_prefs_key +from utilities.prefs_constants import dynamicToolTipBendAnglePrecision_prefs_key +from utilities.prefs_constants import dynamicToolTipVdwRadiiInAtomDistance_prefs_key +from utilities.prefs_constants import displayFontPointSize_prefs_key +from utilities.prefs_constants import useSelectedFont_prefs_key +from utilities.prefs_constants import displayFont_prefs_key +from utilities.prefs_constants import keepBondsDuringTransmute_prefs_key debug_sliders = False # Do not commit as True @@ -231,7 +231,7 @@ def startup_commandName(): #bruce 060403 def parentless_open_dialog_pref(): #bruce 060710 for Mac A8 # see if setting this True fixes the Mac-specific bugs in draggability of this dialog, and CPU usage while it's up - from debug_prefs import debug_pref, Choice_boolean_False + from utilities.debug_prefs import debug_pref, Choice_boolean_False return debug_pref("parentless open file dialogs?", Choice_boolean_False, prefs_key = "A8.1 devel/parentless open file dialogs") @@ -1548,7 +1548,7 @@ restored when the user undoes a structural change.</p> self.current_height_spinbox.setValue(size[1]) # Set string of Saved Size Lineedits - from prefs_constants import mainwindow_geometry_prefs_key_prefix + from utilities.prefs_constants import mainwindow_geometry_prefs_key_prefix keyprefix = mainwindow_geometry_prefs_key_prefix pos, size = _get_prefs_for_window_pos_size( self.w, keyprefix) self.update_saved_size(size[0], size[1]) @@ -1995,7 +1995,7 @@ restored when the user undoes a structural change.</p> self.w.showElementColorSettings(self) def usual_change_color(self, prefs_key, caption = "choose"): #bruce 050805 - from prefs_widgets import colorpref_edit_dialog + from widgets.prefs_widgets import colorpref_edit_dialog colorpref_edit_dialog( self, prefs_key, caption = caption) def change_atom_hilite_color(self): @@ -3120,7 +3120,7 @@ restored when the user undoes a structural change.</p> self.saved_height_lineedit.setText(QString(str(h) + " pixels")) def save_current_win_pos_and_size(self): #bruce 051218; see also debug.py's _debug_save_window_layout - from prefs_constants import mainwindow_geometry_prefs_key_prefix + from utilities.prefs_constants import mainwindow_geometry_prefs_key_prefix keyprefix = mainwindow_geometry_prefs_key_prefix save_window_pos_size( self.w, keyprefix) # prints history message size = self.w.size() @@ -3131,7 +3131,7 @@ restored when the user undoes a structural change.</p> """ Restore the window size, but not the position, from the prefs db. """ - from prefs_constants import mainwindow_geometry_prefs_key_prefix + from utilities.prefs_constants import mainwindow_geometry_prefs_key_prefix keyprefix = mainwindow_geometry_prefs_key_prefix pos, size = _get_prefs_for_window_pos_size( self.w, keyprefix) w = size[0] diff --git a/cad/src/ne1_ui/ViewOrientationWindow.py b/cad/src/ne1_ui/ViewOrientationWindow.py index 1502b3040..58a3fb725 100755 --- a/cad/src/ne1_ui/ViewOrientationWindow.py +++ b/cad/src/ne1_ui/ViewOrientationWindow.py @@ -20,7 +20,7 @@ from PyQt4 import QtCore, QtGui from PyQt4.Qt import Qt, SIGNAL, QMainWindow, QDockWidget from ne1_ui.Ui_ViewOrientation import Ui_ViewOrientation -from icon_utilities import geticon +from utilities.icon_utilities import geticon class ViewOrientationWindow(QDockWidget, Ui_ViewOrientation): diff --git a/cad/src/ne1_ui/WhatsThisText_for_MainWindow.py b/cad/src/ne1_ui/WhatsThisText_for_MainWindow.py index 5560e847f..a4ff15b94 100755 --- a/cad/src/ne1_ui/WhatsThisText_for_MainWindow.py +++ b/cad/src/ne1_ui/WhatsThisText_for_MainWindow.py @@ -140,7 +140,7 @@ def createWhatsThisTextForMainWindowWidgets(win): # Redo - from PlatformDependent import is_macintosh + from platform.PlatformDependent import is_macintosh if is_macintosh(): redo_accel = "(Ctrl + Shift + Z)" # note: this is further #modified (Ctrl -> Cmd) by other code diff --git a/cad/src/ne1_ui/cursors.py b/cad/src/ne1_ui/cursors.py index bdf4d4711..5d3b18250 100755 --- a/cad/src/ne1_ui/cursors.py +++ b/cad/src/ne1_ui/cursors.py @@ -17,7 +17,7 @@ self.o.setCursor(win.ArrowCursor)). from PyQt4.Qt import QCursor, QBitmap, Qt, QPainter import os, sys -from icon_utilities import getCursorPixmap +from utilities.icon_utilities import getCursorPixmap def loadCursors(w): """ diff --git a/cad/src/ne1_ui/help/help.py b/cad/src/ne1_ui/help/help.py index cf96242ba..544782bdf 100755 --- a/cad/src/ne1_ui/help/help.py +++ b/cad/src/ne1_ui/help/help.py @@ -27,7 +27,7 @@ from PyQt4.Qt import QWidget from PyQt4.Qt import SIGNAL from ne1_ui.help.HelpDialog import Ui_HelpDialog -from icon_utilities import geticon +from utilities.icon_utilities import geticon class Ne1HelpDialog(QWidget, Ui_HelpDialog): """ diff --git a/cad/src/ne1_ui/menus/Ui_BuildStructuresMenu.py b/cad/src/ne1_ui/menus/Ui_BuildStructuresMenu.py index d08b6e0cb..cfb55fc7d 100755 --- a/cad/src/ne1_ui/menus/Ui_BuildStructuresMenu.py +++ b/cad/src/ne1_ui/menus/Ui_BuildStructuresMenu.py @@ -4,7 +4,7 @@ $Id$ """ from PyQt4 import QtGui -from debug_prefs import debug_pref, Choice_boolean_False +from utilities.debug_prefs import debug_pref, Choice_boolean_False def setupUi(win): """ diff --git a/cad/src/ne1_ui/menus/Ui_InsertMenu.py b/cad/src/ne1_ui/menus/Ui_InsertMenu.py index 3684814d4..61cde3033 100755 --- a/cad/src/ne1_ui/menus/Ui_InsertMenu.py +++ b/cad/src/ne1_ui/menus/Ui_InsertMenu.py @@ -4,7 +4,7 @@ $Id$ """ from PyQt4 import QtGui -from debug_prefs import debug_pref, Choice_boolean_False +from utilities.debug_prefs import debug_pref, Choice_boolean_False def setupUi(win): """ diff --git a/cad/src/ne1_ui/menus/Ui_SimulationMenu.py b/cad/src/ne1_ui/menus/Ui_SimulationMenu.py index f72b2c214..6d07b77f2 100755 --- a/cad/src/ne1_ui/menus/Ui_SimulationMenu.py +++ b/cad/src/ne1_ui/menus/Ui_SimulationMenu.py @@ -4,8 +4,8 @@ $Id$ """ from PyQt4 import QtGui -from icon_utilities import geticon -from debug_prefs import debug_pref, Choice_boolean_False +from utilities.icon_utilities import geticon +from utilities.debug_prefs import debug_pref, Choice_boolean_False def setupUi(win): """ diff --git a/cad/src/ne1_ui/toolbars/Ui_BuildStructuresToolBar.py b/cad/src/ne1_ui/toolbars/Ui_BuildStructuresToolBar.py index 4aa5f1aef..127535f87 100755 --- a/cad/src/ne1_ui/toolbars/Ui_BuildStructuresToolBar.py +++ b/cad/src/ne1_ui/toolbars/Ui_BuildStructuresToolBar.py @@ -5,7 +5,7 @@ $Id$ from PyQt4 import QtGui from foundation.wiki_help import QToolBar_WikiHelp -from debug_prefs import debug_pref, Choice_boolean_False +from utilities.debug_prefs import debug_pref, Choice_boolean_False def setupUi(win, toolbarArea): """ diff --git a/cad/src/ne1_ui/toolbars/Ui_CntFlyout.py b/cad/src/ne1_ui/toolbars/Ui_CntFlyout.py index 37a47b1c8..7421bcc1f 100644 --- a/cad/src/ne1_ui/toolbars/Ui_CntFlyout.py +++ b/cad/src/ne1_ui/toolbars/Ui_CntFlyout.py @@ -19,7 +19,7 @@ import foundation.env as env from PyQt4 import QtCore, QtGui from PyQt4.Qt import Qt from PyQt4.Qt import SIGNAL -from icon_utilities import geticon +from utilities.icon_utilities import geticon from utilities.Log import greenmsg _theCntFlyout = None diff --git a/cad/src/ne1_ui/toolbars/Ui_CommandToolbar.py b/cad/src/ne1_ui/toolbars/Ui_CommandToolbar.py index a3c950ec1..bad1ed9b0 100755 --- a/cad/src/ne1_ui/toolbars/Ui_CommandToolbar.py +++ b/cad/src/ne1_ui/toolbars/Ui_CommandToolbar.py @@ -55,7 +55,7 @@ from PyQt4.Qt import QSpacerItem from PyQt4.Qt import QString from PyQt4.Qt import QPalette -from icon_utilities import geticon +from utilities.icon_utilities import geticon from foundation.wiki_help import QToolBar_WikiHelp from commandToolbar.CommandToolbar_Constants import cmdTbarCntrlAreaBtnColor from commandToolbar.CommandToolbar_Constants import cmdTbarSubCntrlAreaBtnColor diff --git a/cad/src/ne1_ui/toolbars/Ui_DnaFlyout.py b/cad/src/ne1_ui/toolbars/Ui_DnaFlyout.py index e99353380..1b344d9f7 100644 --- a/cad/src/ne1_ui/toolbars/Ui_DnaFlyout.py +++ b/cad/src/ne1_ui/toolbars/Ui_DnaFlyout.py @@ -16,7 +16,7 @@ import foundation.env as env from PyQt4 import QtCore, QtGui from PyQt4.Qt import Qt from PyQt4.Qt import SIGNAL -from icon_utilities import geticon +from utilities.icon_utilities import geticon from utilities.Log import greenmsg _theDnaFlyout = None diff --git a/cad/src/operations/__init__.py b/cad/src/operations/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/cad/src/operations/__init__.py diff --git a/cad/src/bond_chains.py b/cad/src/operations/bond_chains.py index 0f8465f9b..0f8465f9b 100644 --- a/cad/src/bond_chains.py +++ b/cad/src/operations/bond_chains.py diff --git a/cad/src/bond_utils.py b/cad/src/operations/bond_utils.py index cc2e07d06..1770fb856 100755 --- a/cad/src/bond_utils.py +++ b/cad/src/operations/bond_utils.py @@ -14,10 +14,10 @@ created by bruce 050705 to help with higher-order bonds for Alpha6. """ from geometry.VQT import Q -from constants import noop +from utilities.constants import noop import foundation.env as env from utilities.Log import greenmsg, redmsg, orangemsg, quote_html -from debug import print_compact_stack +from utilities.debug import print_compact_stack from model.bond_constants import bonded_atoms_summary from model.bond_constants import btype_from_v6 diff --git a/cad/src/bonds_from_atoms.py b/cad/src/operations/bonds_from_atoms.py index a9114430d..e692915c8 100755 --- a/cad/src/bonds_from_atoms.py +++ b/cad/src/operations/bonds_from_atoms.py @@ -416,13 +416,13 @@ def inferBonds(mol): # [probably by Will; TODO: needs docstring] removable[key2] = sing2 for badGuy in removable.values(): badGuy.kill() - from bonds_from_atoms import make_bonds + from operations.bonds_from_atoms import make_bonds make_bonds(mol.atoms.values()) return # == -from debug import register_debug_menu_command +from utilities.debug import register_debug_menu_command def remake_bonds_in_selection( glpane ): """ diff --git a/cad/src/chem_patterns.py b/cad/src/operations/chem_patterns.py index 2bc618890..5c65b5c52 100755 --- a/cad/src/chem_patterns.py +++ b/cad/src/operations/chem_patterns.py @@ -16,9 +16,9 @@ Todo later: __author__ = "bruce" import foundation.env as env -import debug +import utilities.debug as debug -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals cmdname = "Select Bad Atoms" diff --git a/cad/src/jigmakers_Mixin.py b/cad/src/operations/jigmakers_Mixin.py index d1690a808..d1690a808 100644 --- a/cad/src/jigmakers_Mixin.py +++ b/cad/src/operations/jigmakers_Mixin.py diff --git a/cad/src/op_select_doubly.py b/cad/src/operations/op_select_doubly.py index e915b712c..e915b712c 100755 --- a/cad/src/op_select_doubly.py +++ b/cad/src/operations/op_select_doubly.py diff --git a/cad/src/ops_atoms.py b/cad/src/operations/ops_atoms.py index 752a19443..a9cb0b704 100755 --- a/cad/src/ops_atoms.py +++ b/cad/src/operations/ops_atoms.py @@ -14,9 +14,9 @@ from existing modules, from class Part and class basicMode. from utilities.Log import greenmsg, redmsg -from constants import SELWHAT_CHUNKS, SELWHAT_ATOMS +from utilities.constants import SELWHAT_CHUNKS, SELWHAT_ATOMS -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals from model.elements import Singlet import foundation.env as env diff --git a/cad/src/ops_connected.py b/cad/src/operations/ops_connected.py index eeaf0be1b..77e6d7d9f 100755 --- a/cad/src/ops_connected.py +++ b/cad/src/operations/ops_connected.py @@ -59,7 +59,7 @@ class ops_connected_Mixin: else: natoms += 1 # Counts atom that is already picked. - from PlatformDependent import fix_plurals + from platform.PlatformDependent import fix_plurals info = fix_plurals( "%d new atom(s) selected." % natoms) env.history.message( cmd + info) self.o.gl_update() @@ -91,7 +91,7 @@ class ops_connected_Mixin: # Just in case a selection filter was applied to this atom. natoms += 1 - from PlatformDependent import fix_plurals + from platform.PlatformDependent import fix_plurals info = fix_plurals( "%d atom(s) unselected." % natoms) env.history.message( cmd + info) self.o.gl_update() @@ -135,7 +135,7 @@ class ops_connected_Mixin: natoms += 1 atom.kill() - from PlatformDependent import fix_plurals + from platform.PlatformDependent import fix_plurals info = fix_plurals( "%d connected atom(s) deleted." % natoms) #bruce 060331 comment: this message is sometimes wrong, since caller has deleted some atoms on click 1 of # a double click, and then calls us on click 2 to delete the atoms connected to the neighbors of those. @@ -163,12 +163,12 @@ class ops_connected_Mixin: return alreadySelected = len(self.selatoms.values()) - from op_select_doubly import select_doubly # new code, bruce 050520 + from operations.op_select_doubly import select_doubly # new code, bruce 050520 #e could also reload it now to speed devel! select_doubly(self.selatoms.values()) #e optim totalSelected = len(self.selatoms.values()) - from PlatformDependent import fix_plurals + from platform.PlatformDependent import fix_plurals info = fix_plurals("%d new atom(s) selected (besides the %d initially selected)." % \ (totalSelected - alreadySelected, alreadySelected) ) env.history.message( cmd + info) diff --git a/cad/src/ops_copy.py b/cad/src/operations/ops_copy.py index fb838cdf3..438a626cf 100755 --- a/cad/src/ops_copy.py +++ b/cad/src/operations/ops_copy.py @@ -14,18 +14,18 @@ bruce 050507 made this by collecting appropriate methods from class Part. from utilities import debug_flags import foundation.env as env -from debug import print_compact_stack +from utilities.debug import print_compact_stack from utilities.Log import greenmsg, redmsg, orangemsg -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals from foundation.Group import Group from model.chunk import Chunk from model.chunk import mol_copy_name from model.chem import Atom_prekill_prep -from ops_select import Selection +from operations.ops_select import Selection from model.bonds import bond_copied_atoms -from constants import gensym -from ops_select import selection_from_part -from constants import noop +from utilities.constants import gensym +from operations.ops_select import selection_from_part +from utilities.constants import noop from geometry.VQT import V from geometry.BoundingBox import BBox from model.jigs import Jig @@ -167,9 +167,9 @@ class ops_copy_Mixin: # and emit message about what we're about to do if debug_flags.atom_debug: #bruce 050811 fixed this for A6 (it was a non-debug reload) print "atom_debug: fyi: importing or reloading ops_copy from itself" - import ops_copy as hmm + import operations.ops_copy as hmm reload(hmm) - from ops_copy import Copier # use latest code for that class, even if not for this mixin method! + from operations.ops_copy import Copier # use latest code for that class, even if not for this mixin method! copier = Copier(sel) #e sel.copier()? copier.prep_for_copy_to_shelf() if copier.objectsCopied == 0: # wware 20051128, bug 1118, no error msg if already given @@ -217,9 +217,9 @@ class ops_copy_Mixin: # and emit message about what we're about to do if debug_flags.atom_debug: #bruce 050811 fixed this for A6 (it was a non-debug reload) print "atom_debug: fyi: importing or reloading ops_copy from itself" - import ops_copy as hmm + import operations.ops_copy as hmm reload(hmm) - from ops_copy import Copier # use latest code for that class, even if not for this mixin method! + from operations.ops_copy import Copier # use latest code for that class, even if not for this mixin method! copier = Copier(sel) #e sel.copier()? copier.prep_for_copy_to_shelf() if copier.objectsCopied == 0: # wware 20051128, bug 1118, no error msg if already given @@ -266,9 +266,9 @@ class ops_copy_Mixin: sel = selection_from_part(entire_part, use_selatoms = True) #k use_selatoms is a guess if debug_flags.atom_debug: print "atom_debug: fyi: importing or reloading ops_copy from itself" - import ops_copy as hmm + import operations.ops_copy as hmm reload(hmm) - from ops_copy import Copier # use latest code for that class, even if not for this mixin method! + from operations.ops_copy import Copier # use latest code for that class, even if not for this mixin method! copier = Copier(sel) #e sel.copier()? copier.prep_for_copy_to_shelf() ###k guess: same prep method should be ok if copier.ok(): diff --git a/cad/src/ops_display.py b/cad/src/operations/ops_display.py index 346ef64f0..6c30fdea6 100644 --- a/cad/src/ops_display.py +++ b/cad/src/operations/ops_display.py @@ -20,15 +20,15 @@ import foundation.env as env # Keep these in the same order that they are defined in constants.py. # It really helps since some lists are dependent on the display mode order. # Mark 2008-02-13. -from constants import diDEFAULT -from constants import diINVISIBLE -from constants import diLINES -from constants import diTUBES -from constants import diBALL -from constants import diTrueCPK -from constants import diDNACYLINDER -from constants import diCYLINDER -from constants import diSURFACE +from utilities.constants import diDEFAULT +from utilities.constants import diINVISIBLE +from utilities.constants import diLINES +from utilities.constants import diTUBES +from utilities.constants import diBALL +from utilities.constants import diTrueCPK +from utilities.constants import diDNACYLINDER +from utilities.constants import diCYLINDER +from utilities.constants import diSURFACE from PyQt4.Qt import Qt, QColorDialog, QColor @@ -204,7 +204,7 @@ class displaySlotsMixin: _cmd = greenmsg("Change Color: ") - from ops_select import objectSelected, ATOMS, CHUNKS, JIGS + from operations.ops_select import objectSelected, ATOMS, CHUNKS, JIGS if not objectSelected(self.assy, objectFlags = CHUNKS | JIGS): if objectSelected(self.assy, objectFlags = ATOMS): _msg = redmsg("Cannot change color of individual atoms.") diff --git a/cad/src/ops_files.py b/cad/src/operations/ops_files.py index f99b3afdc..8b558e0d8 100755 --- a/cad/src/ops_files.py +++ b/cad/src/operations/ops_files.py @@ -34,7 +34,7 @@ from PyQt4.Qt import QStringList import foundation.env as env from utilities import debug_flags -from PlatformDependent import find_or_make_Nanorex_subdir +from platform.PlatformDependent import find_or_make_Nanorex_subdir from model.assembly import assembly @@ -45,18 +45,18 @@ from graphics.rendering.fileIO import writepovfile from graphics.rendering.fileIO import writemdlfile from graphics.rendering.qutemol.qutemol import write_qutemol_pdb_file -from debug import print_compact_traceback -from debug import linenum -from debug import begin_timing, end_timing +from utilities.debug import print_compact_traceback +from utilities.debug import linenum +from utilities.debug import begin_timing, end_timing from utilities.Log import greenmsg, redmsg, orangemsg, _graymsg -from prefs_constants import getDefaultWorkingDirectory -from prefs_constants import workingDirectory_prefs_key -from prefs_constants import toolbar_state_prefs_key +from utilities.prefs_constants import getDefaultWorkingDirectory +from utilities.prefs_constants import workingDirectory_prefs_key +from utilities.prefs_constants import toolbar_state_prefs_key -from debug_prefs import Choice_boolean_False -from debug_prefs import debug_pref +from utilities.debug_prefs import Choice_boolean_False +from utilities.debug_prefs import debug_pref debug_babel = False # DO NOT COMMIT with True diff --git a/cad/src/ops_modify.py b/cad/src/operations/ops_modify.py index 288731832..b2cbc1712 100644 --- a/cad/src/ops_modify.py +++ b/cad/src/operations/ops_modify.py @@ -4,7 +4,7 @@ ops_modify.py provides modifySlotsMixin for MWsemantics, with modify slot methods and related helper methods. @author: Mark -@version: $Id:$ +@version: $Id$ @copyright: 2008 Nanorex, Inc. See LICENSE file for details. Note: most other ops_*.py files provide mixin classes for Part, @@ -29,9 +29,9 @@ class modifySlotsMixin: """ if debug_flags.atom_debug: print "debug: reloading runSim on each use, for development" - import runSim, debug + import simulation.runSim as runSim, utilities.debug as debug debug.reload_once_per_event(runSim) - from runSim import Minimize_CommandRun + from simulation.runSim import Minimize_CommandRun cmdrun = Minimize_CommandRun( self, 'Sel', type = 'Adjust') cmdrun.run() return @@ -42,9 +42,9 @@ class modifySlotsMixin: """ if debug_flags.atom_debug: print "debug: reloading runSim on each use, for development" - import runSim, debug + import simulation.runSim as runSim, utilities.debug as debug debug.reload_once_per_event(runSim) - from runSim import Minimize_CommandRun + from simulation.runSim import Minimize_CommandRun cmdrun = Minimize_CommandRun( self, 'All', type = 'Adjust') cmdrun.run() return diff --git a/cad/src/ops_motion.py b/cad/src/operations/ops_motion.py index 3079ac35c..a6ba62ba0 100755 --- a/cad/src/ops_motion.py +++ b/cad/src/operations/ops_motion.py @@ -13,11 +13,11 @@ bruce 050507 made this by collecting appropriate methods from class Part. """ from utilities.Log import greenmsg, redmsg -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals from geometry.VQT import V, norm, Q, vlen, orthodist import foundation.env as env from math import pi -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from model.chunk import Chunk from model.jigs import Jig diff --git a/cad/src/ops_rechunk.py b/cad/src/operations/ops_rechunk.py index 1337a4c3e..30a5c677e 100755 --- a/cad/src/ops_rechunk.py +++ b/cad/src/operations/ops_rechunk.py @@ -12,14 +12,14 @@ bruce 050507 made this by collecting appropriate methods from class Part. """ from utilities.Log import greenmsg, redmsg -from PlatformDependent import fix_plurals +from platform.PlatformDependent import fix_plurals from model.chunk import Chunk -from constants import gensym +from utilities.constants import gensym from dna.model.Dna_Constants import getNextStrandColor import foundation.env as env -from debug_prefs import debug_pref, Choice_boolean_False -from debug import print_compact_stack -from runSim import adjustSinglet +from utilities.debug_prefs import debug_pref, Choice_boolean_False +from utilities.debug import print_compact_stack +from simulation.runSim import adjustSinglet class ops_rechunk_Mixin: """ diff --git a/cad/src/ops_select.py b/cad/src/operations/ops_select.py index 1f56e9b79..a9f15acc1 100755 --- a/cad/src/ops_select.py +++ b/cad/src/operations/ops_select.py @@ -11,8 +11,8 @@ History: bruce 050507 made this by collecting appropriate methods from class Part. """ -from constants import SELWHAT_CHUNKS, SELWHAT_ATOMS -from constants import diINVISIBLE, diDEFAULT +from utilities.constants import SELWHAT_CHUNKS, SELWHAT_ATOMS +from utilities.constants import diINVISIBLE, diDEFAULT from model.jigs import Jig from model.chem import _changed_picked_Atoms from model.chunk import Chunk @@ -21,11 +21,11 @@ from geometry.VQT import V, A, norm, cross from Numeric import dot, transpose import foundation.env as env from utilities.Log import redmsg, greenmsg, orangemsg -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from utilities import debug_flags -from PlatformDependent import fix_plurals -from GlobalPreferences import permit_atom_chunk_coselection -from icon_utilities import geticon +from platform.PlatformDependent import fix_plurals +from utilities.GlobalPreferences import permit_atom_chunk_coselection +from utilities.icon_utilities import geticon from dna.model.DnaGroup import DnaGroup from cnt.model.CntGroup import CntGroup diff --git a/cad/src/ops_view.py b/cad/src/operations/ops_view.py index 1e51b40a0..a7e1fab0b 100755 --- a/cad/src/ops_view.py +++ b/cad/src/operations/ops_view.py @@ -20,8 +20,8 @@ from geometry.geometryUtilities import compute_heuristic_axis import foundation.env as env from geometry.VQT import V, Q, A, norm, vlen from utilities.Log import greenmsg, redmsg, orangemsg -from prefs_constants import ORTHOGRAPHIC -from prefs_constants import PERSPECTIVE +from utilities.prefs_constants import ORTHOGRAPHIC +from utilities.prefs_constants import PERSPECTIVE from model.NamedView import NamedView from model.PovrayScene import PovrayScene diff --git a/cad/src/pastables.py b/cad/src/operations/pastables.py index 7a94d0300..7a94d0300 100644 --- a/cad/src/pastables.py +++ b/cad/src/operations/pastables.py diff --git a/cad/src/reposition_baggage.py b/cad/src/operations/reposition_baggage.py index 41634292c..41634292c 100755 --- a/cad/src/reposition_baggage.py +++ b/cad/src/operations/reposition_baggage.py diff --git a/cad/src/undo_UI.py b/cad/src/operations/undo_UI.py index 43fe3089f..2e9e6c446 100644 --- a/cad/src/undo_UI.py +++ b/cad/src/operations/undo_UI.py @@ -20,7 +20,7 @@ out of undo_manager.py [as of 071025], so they may be misleadingly out of context. """ -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback import foundation.env as env from utilities.Log import greenmsg, redmsg, _graymsg diff --git a/cad/src/outtakes/MMKit.py b/cad/src/outtakes/MMKit.py index 71b287a10..789e2e14e 100755 --- a/cad/src/outtakes/MMKit.py +++ b/cad/src/outtakes/MMKit.py @@ -37,7 +37,7 @@ from PyQt4.Qt import QDir, QTreeView, QTreeWidgetItem, QAbstractItemDelegate, QW from MMKitDialog import Ui_MMKitDialog from graphics.widgets.ThumbView import MMKitView, ChunkView from model.elements import PeriodicTable -from constants import diTUBES +from utilities.constants import diTUBES ## from chem import Atom [not used i think - bruce 071113] ## from chunk import Chunk [not used i think - bruce 071113] from foundation.Utility import imagename_to_icon, geticon @@ -46,10 +46,10 @@ from files.mmp.files_mmp import readmmp from model.part import Part import foundation.env as env from utilities import debug_flags -from debug import print_compact_traceback -from Sponsors import SponsorableMixin +from utilities.debug import print_compact_traceback +from sponsors.Sponsors import SponsorableMixin from PropertyManagerMixin import PropertyManagerMixin, pmSetPropMgrIcon, pmSetPropMgrTitle -from PropMgr_Constants import pmMMKitPageMargin +from PM.PropMgr_Constants import pmMMKitPageMargin from model.bond_constants import btype_from_v6 # PageId constants for mmkit_tab @@ -189,7 +189,7 @@ class MMKit(QDialog, # adding a warning in the menu text, and adding a try/except to help in debugging this if anyone ever wants to. # (If the bugs Will mentioned go away entirely, we can abandon support for the False value instead of fixing it, # as Will suggested.) - from debug_prefs import debug_pref, Choice_boolean_True + from utilities.debug_prefs import debug_pref, Choice_boolean_True self.icon_tabs = debug_pref("use icons in MMKit tabs? (only True works in Qt4)", Choice_boolean_True, prefs_key = "A7/mmkit tab icons/Qt4") #e Changes to this only take effect in the next session. @@ -1010,7 +1010,7 @@ class MMKit(QDialog, if self.w.assy.filename: odir = os.path.dirname(self.w.assy.filename) else: - from prefs_constants import workingDirectory_prefs_key + from utilities.prefs_constants import workingDirectory_prefs_key odir = env.prefs[workingDirectory_prefs_key] fdir = QFileDialog.getExistingDirectory(self, "Choose library directory", odir) diff --git a/cad/src/outtakes/MMKitDialog.py b/cad/src/outtakes/MMKitDialog.py index 1fdb04ab3..76121d2d0 100755 --- a/cad/src/outtakes/MMKitDialog.py +++ b/cad/src/outtakes/MMKitDialog.py @@ -48,31 +48,31 @@ from PropertyManagerMixin import pmAddTopRowButtons from PropertyManagerMixin import pmMessageGroupBox from PropertyManagerMixin import pmAddBottomSpacer -from PropMgr_Constants import pmDoneButton -from PropMgr_Constants import pmWhatsThisButton -from PropMgr_Constants import pmMainVboxLayoutMargin -from PropMgr_Constants import pmMainVboxLayoutSpacing -from PropMgr_Constants import pmHeaderFrameMargin -from PropMgr_Constants import pmHeaderFrameSpacing -from PropMgr_Constants import getHeaderFont -from PropMgr_Constants import pmLabelLeftAlignment -from PropMgr_Constants import pmSponsorFrameMargin -from PropMgr_Constants import pmSponsorFrameSpacing -from PropMgr_Constants import pmGroupBoxSpacing -from PropMgr_Constants import pmTopRowBtnsMargin -from PropMgr_Constants import pmTopRowBtnsSpacing -from PropMgr_Constants import pmMessageTextEditColor -from PropMgr_Constants import pmGrpBoxVboxLayoutMargin -from PropMgr_Constants import pmGrpBoxVboxLayoutSpacing -from PropMgr_Constants import pmMMKitPageMargin -from PropMgr_Constants import pmMMKitButtonFont -from PropMgr_Constants import pmMMKitButtonFontPointSize -from PropMgr_Constants import pmMMKitButtonFontBold -from PropMgr_Constants import pmMMKitButtonHeight -from PropMgr_Constants import pmMMKitButtonWidth -from prefs_constants import buildModeAutobondEnabled_prefs_key -from prefs_constants import buildModeHighlightingEnabled_prefs_key -from prefs_constants import buildModeWaterEnabled_prefs_key +from PM.PropMgr_Constants import pmDoneButton +from PM.PropMgr_Constants import pmWhatsThisButton +from PM.PropMgr_Constants import pmMainVboxLayoutMargin +from PM.PropMgr_Constants import pmMainVboxLayoutSpacing +from PM.PropMgr_Constants import pmHeaderFrameMargin +from PM.PropMgr_Constants import pmHeaderFrameSpacing +from PM.PropMgr_Constants import getHeaderFont +from PM.PropMgr_Constants import pmLabelLeftAlignment +from PM.PropMgr_Constants import pmSponsorFrameMargin +from PM.PropMgr_Constants import pmSponsorFrameSpacing +from PM.PropMgr_Constants import pmGroupBoxSpacing +from PM.PropMgr_Constants import pmTopRowBtnsMargin +from PM.PropMgr_Constants import pmTopRowBtnsSpacing +from PM.PropMgr_Constants import pmMessageTextEditColor +from PM.PropMgr_Constants import pmGrpBoxVboxLayoutMargin +from PM.PropMgr_Constants import pmGrpBoxVboxLayoutSpacing +from PM.PropMgr_Constants import pmMMKitPageMargin +from PM.PropMgr_Constants import pmMMKitButtonFont +from PM.PropMgr_Constants import pmMMKitButtonFontPointSize +from PM.PropMgr_Constants import pmMMKitButtonFontBold +from PM.PropMgr_Constants import pmMMKitButtonHeight +from PM.PropMgr_Constants import pmMMKitButtonWidth +from utilities.prefs_constants import buildModeAutobondEnabled_prefs_key +from utilities.prefs_constants import buildModeHighlightingEnabled_prefs_key +from utilities.prefs_constants import buildModeWaterEnabled_prefs_key class Ui_MMKitDialog(object): """ diff --git a/cad/src/outtakes/PropMgrBaseClass.py b/cad/src/outtakes/PropMgrBaseClass.py index d15c0ef86..f7627efbe 100755 --- a/cad/src/outtakes/PropMgrBaseClass.py +++ b/cad/src/outtakes/PropMgrBaseClass.py @@ -75,47 +75,47 @@ from PyQt4.Qt import QTextCursor from utilities import debug_flags -from icon_utilities import geticon, getpixmap -from debug import print_compact_traceback - -from PropMgr_Constants import pmColor -from PropMgr_Constants import pmTitleFrameColor -from PropMgr_Constants import pmTitleLabelColor -from PropMgr_Constants import pmMinWidth -from PropMgr_Constants import pmDefaultWidth -from PropMgr_Constants import pmLabelRightAlignment -from PropMgr_Constants import pmLabelLeftAlignment -from PropMgr_Constants import pmMainVboxLayoutMargin -from PropMgr_Constants import pmMainVboxLayoutSpacing -from PropMgr_Constants import pmHeaderFrameMargin -from PropMgr_Constants import pmHeaderFrameSpacing -from PropMgr_Constants import getHeaderFont -from PropMgr_Constants import pmSponsorFrameMargin -from PropMgr_Constants import pmSponsorFrameSpacing -from PropMgr_Constants import pmTopRowBtnsMargin -from PropMgr_Constants import pmTopRowBtnsSpacing -from PropMgr_Constants import pmGroupBoxSpacing -from PropMgr_Constants import pmGrpBoxVboxLayoutMargin -from PropMgr_Constants import pmGrpBoxVboxLayoutSpacing -from PropMgr_Constants import pmGridLayoutMargin -from PropMgr_Constants import pmGridLayoutSpacing -from PropMgr_Constants import pmGrpBoxButtonColor -from PropMgr_Constants import pmGrpBoxButtonBorderColor -from PropMgr_Constants import pmGrpBoxButtonTextColor -from PropMgr_Constants import pmGrpBoxExpandedImage -from PropMgr_Constants import pmGrpBoxCollapsedImage -from PropMgr_Constants import pmGrpBoxGridLayoutMargin -from PropMgr_Constants import pmGrpBoxGridLayoutSpacing -from PropMgr_Constants import pmGrpBoxColor -from PropMgr_Constants import pmGrpBoxBorderColor -from PropMgr_Constants import pmMsgGrpBoxMargin -from PropMgr_Constants import pmMsgGrpBoxSpacing -from PropMgr_Constants import pmMessageTextEditColor -from PropMgr_Constants import pmDoneButton -from PropMgr_Constants import pmCancelButton -from PropMgr_Constants import pmRestoreDefaultsButton -from PropMgr_Constants import pmPreviewButton -from PropMgr_Constants import pmWhatsThisButton +from utilities.icon_utilities import geticon, getpixmap +from utilities.debug import print_compact_traceback + +from PM.PropMgr_Constants import pmColor +from PM.PropMgr_Constants import pmTitleFrameColor +from PM.PropMgr_Constants import pmTitleLabelColor +from PM.PropMgr_Constants import pmMinWidth +from PM.PropMgr_Constants import pmDefaultWidth +from PM.PropMgr_Constants import pmLabelRightAlignment +from PM.PropMgr_Constants import pmLabelLeftAlignment +from PM.PropMgr_Constants import pmMainVboxLayoutMargin +from PM.PropMgr_Constants import pmMainVboxLayoutSpacing +from PM.PropMgr_Constants import pmHeaderFrameMargin +from PM.PropMgr_Constants import pmHeaderFrameSpacing +from PM.PropMgr_Constants import getHeaderFont +from PM.PropMgr_Constants import pmSponsorFrameMargin +from PM.PropMgr_Constants import pmSponsorFrameSpacing +from PM.PropMgr_Constants import pmTopRowBtnsMargin +from PM.PropMgr_Constants import pmTopRowBtnsSpacing +from PM.PropMgr_Constants import pmGroupBoxSpacing +from PM.PropMgr_Constants import pmGrpBoxVboxLayoutMargin +from PM.PropMgr_Constants import pmGrpBoxVboxLayoutSpacing +from PM.PropMgr_Constants import pmGridLayoutMargin +from PM.PropMgr_Constants import pmGridLayoutSpacing +from PM.PropMgr_Constants import pmGrpBoxButtonColor +from PM.PropMgr_Constants import pmGrpBoxButtonBorderColor +from PM.PropMgr_Constants import pmGrpBoxButtonTextColor +from PM.PropMgr_Constants import pmGrpBoxExpandedImage +from PM.PropMgr_Constants import pmGrpBoxCollapsedImage +from PM.PropMgr_Constants import pmGrpBoxGridLayoutMargin +from PM.PropMgr_Constants import pmGrpBoxGridLayoutSpacing +from PM.PropMgr_Constants import pmGrpBoxColor +from PM.PropMgr_Constants import pmGrpBoxBorderColor +from PM.PropMgr_Constants import pmMsgGrpBoxMargin +from PM.PropMgr_Constants import pmMsgGrpBoxSpacing +from PM.PropMgr_Constants import pmMessageTextEditColor +from PM.PropMgr_Constants import pmDoneButton +from PM.PropMgr_Constants import pmCancelButton +from PM.PropMgr_Constants import pmRestoreDefaultsButton +from PM.PropMgr_Constants import pmPreviewButton +from PM.PropMgr_Constants import pmWhatsThisButton # Special Qt debugging functions written by Mark. 2007-05-24 ############ diff --git a/cad/src/outtakes/PropertyManagerMixin.py b/cad/src/outtakes/PropertyManagerMixin.py index 75b6c5eee..06d32a0dd 100755 --- a/cad/src/outtakes/PropertyManagerMixin.py +++ b/cad/src/outtakes/PropertyManagerMixin.py @@ -38,46 +38,46 @@ from PyQt4.Qt import QTextEdit from utilities import debug_flags -from icon_utilities import geticon, getpixmap -from Sponsors import SponsorableMixin -from qt4transition import lineage -from debug import print_compact_traceback +from utilities.icon_utilities import geticon, getpixmap +from sponsors.Sponsors import SponsorableMixin +from utilities.qt4transition import lineage +from utilities.debug import print_compact_traceback from PropMgrBaseClass import PropertyManager_common, getPalette -from PropMgr_Constants import pmColor -from PropMgr_Constants import pmAllButtons -from PropMgr_Constants import pmTitleFrameColor -from PropMgr_Constants import pmTitleLabelColor -from PropMgr_Constants import pmMessageTextEditColor -from PropMgr_Constants import pmGrpBoxColor -from PropMgr_Constants import pmGrpBoxButtonColor -from PropMgr_Constants import pmCheckBoxTextColor -from PropMgr_Constants import pmCheckBoxButtonColor -from PropMgr_Constants import pmGrpBoxBorderColor -from PropMgr_Constants import pmGrpBoxButtonBorderColor -from PropMgr_Constants import pmGrpBoxButtonTextColor -from PropMgr_Constants import pmGrpBoxExpandedImage -from PropMgr_Constants import pmGrpBoxCollapsedImage -from PropMgr_Constants import pmGrpBoxVboxLayoutMargin -from PropMgr_Constants import pmGrpBoxVboxLayoutSpacing -from PropMgr_Constants import pmMainVboxLayoutMargin -from PropMgr_Constants import pmMainVboxLayoutSpacing -from PropMgr_Constants import pmHeaderFrameMargin -from PropMgr_Constants import pmHeaderFrameSpacing -from PropMgr_Constants import pmLabelLeftAlignment -from PropMgr_Constants import getHeaderFont -from PropMgr_Constants import pmSponsorFrameMargin -from PropMgr_Constants import pmSponsorFrameSpacing -from PropMgr_Constants import pmTopRowBtnsMargin -from PropMgr_Constants import pmTopRowBtnsSpacing -from PropMgr_Constants import pmDoneButton -from PropMgr_Constants import pmCancelButton -from PropMgr_Constants import pmRestoreDefaultsButton -from PropMgr_Constants import pmPreviewButton -from PropMgr_Constants import pmWhatsThisButton -from PropMgr_Constants import pmMsgGrpBoxMargin -from PropMgr_Constants import pmMsgGrpBoxSpacing -from PropMgr_Constants import pmMinWidth -from PropMgr_Constants import pmGroupBoxSpacing +from PM.PropMgr_Constants import pmColor +from PM.PropMgr_Constants import pmAllButtons +from PM.PropMgr_Constants import pmTitleFrameColor +from PM.PropMgr_Constants import pmTitleLabelColor +from PM.PropMgr_Constants import pmMessageTextEditColor +from PM.PropMgr_Constants import pmGrpBoxColor +from PM.PropMgr_Constants import pmGrpBoxButtonColor +from PM.PropMgr_Constants import pmCheckBoxTextColor +from PM.PropMgr_Constants import pmCheckBoxButtonColor +from PM.PropMgr_Constants import pmGrpBoxBorderColor +from PM.PropMgr_Constants import pmGrpBoxButtonBorderColor +from PM.PropMgr_Constants import pmGrpBoxButtonTextColor +from PM.PropMgr_Constants import pmGrpBoxExpandedImage +from PM.PropMgr_Constants import pmGrpBoxCollapsedImage +from PM.PropMgr_Constants import pmGrpBoxVboxLayoutMargin +from PM.PropMgr_Constants import pmGrpBoxVboxLayoutSpacing +from PM.PropMgr_Constants import pmMainVboxLayoutMargin +from PM.PropMgr_Constants import pmMainVboxLayoutSpacing +from PM.PropMgr_Constants import pmHeaderFrameMargin +from PM.PropMgr_Constants import pmHeaderFrameSpacing +from PM.PropMgr_Constants import pmLabelLeftAlignment +from PM.PropMgr_Constants import getHeaderFont +from PM.PropMgr_Constants import pmSponsorFrameMargin +from PM.PropMgr_Constants import pmSponsorFrameSpacing +from PM.PropMgr_Constants import pmTopRowBtnsMargin +from PM.PropMgr_Constants import pmTopRowBtnsSpacing +from PM.PropMgr_Constants import pmDoneButton +from PM.PropMgr_Constants import pmCancelButton +from PM.PropMgr_Constants import pmRestoreDefaultsButton +from PM.PropMgr_Constants import pmPreviewButton +from PM.PropMgr_Constants import pmWhatsThisButton +from PM.PropMgr_Constants import pmMsgGrpBoxMargin +from PM.PropMgr_Constants import pmMsgGrpBoxSpacing +from PM.PropMgr_Constants import pmMinWidth +from PM.PropMgr_Constants import pmGroupBoxSpacing def pmVBoxLayout(propMgr): """Create the master vertical box layout for <propMgr>. diff --git a/cad/src/outtakes/TreeWidget.py b/cad/src/outtakes/TreeWidget.py index dc0ad92ca..c4835c391 100755 --- a/cad/src/outtakes/TreeWidget.py +++ b/cad/src/outtakes/TreeWidget.py @@ -20,9 +20,9 @@ and split it into three modules: assert 0, "TreeWidget.py is NO LONGER USED IN Qt4 NE1" #bruce 070503 Qt4 from TreeView import * # including class TreeView, and import * from many other modules -from menu_helpers import makemenu_helper +from widgets.menu_helpers import makemenu_helper from platform import fix_buttons_helper -from debug import DebugMenuMixin, print_compact_stack, print_compact_traceback +from utilities.debug import DebugMenuMixin, print_compact_stack, print_compact_traceback allButtons = (leftButton|midButton|rightButton) #e should be defined in same file as the buttons from utilities import debug_flags from platform import tupleFromQPoint, fix_plurals @@ -447,7 +447,7 @@ class TreeWidget(TreeView, DebugMenuMixin): would need to be separately passed anyway.) """ if debug_flags.atom_debug: #bruce 060713 debug code, safe to be permanent - import debug + import utilities.debug as debug debug._event = event debug._event_state = event.state() debug._event_stateAfter = event.stateAfter() @@ -677,7 +677,7 @@ class TreeWidget(TreeView, DebugMenuMixin): def topmost_selected_nodes(self): #e might be needed by some context menus... how should the makers ask for it? "return a list of all selected nodes as seen by apply2picked, i.e. without looking inside selected Groups" #bruce 050523 revised this - from ops_select import topmost_selected_nodes + from operations.ops_select import topmost_selected_nodes return topmost_selected_nodes( self.topnodes) # selection logic diff --git a/cad/src/outtakes/old_extrude_widgets.py b/cad/src/outtakes/old_extrude_widgets.py index b3cc18bc2..20454dbdc 100644 --- a/cad/src/outtakes/old_extrude_widgets.py +++ b/cad/src/outtakes/old_extrude_widgets.py @@ -12,7 +12,7 @@ from PyQt4.Qt import QVBoxLayout from PyQt4.Qt import QHBoxLayout from PyQt4.Qt import QLabel -from qt4transition import qt4warning, qt4todo +from utilities.qt4transition import qt4warning, qt4todo # These don't exist in Qt4 but we can make begin(QVBox) and # begin(QHBox) act the same as before. diff --git a/cad/src/outtakes/test_polyline_drag.py b/cad/src/outtakes/test_polyline_drag.py index 91c180e03..e2bdd7ced 100644 --- a/cad/src/outtakes/test_polyline_drag.py +++ b/cad/src/outtakes/test_polyline_drag.py @@ -15,13 +15,13 @@ Just a stub for now. """ __author__ = "bruce" -from test_connectWithState import State_preMixin +from prototype.test_connectWithState import State_preMixin -from test_commands import ExampleCommand +from prototype.test_commands import ExampleCommand from geometry.VQT import V -from constants import red +from utilities.constants import red # TODO: import the following from somewhere DX = V(1,0,0) diff --git a/cad/src/outtakes/undo_related_timing_tests.py b/cad/src/outtakes/undo_related_timing_tests.py index 8b367b4dc..8688d196b 100644 --- a/cad/src/outtakes/undo_related_timing_tests.py +++ b/cad/src/outtakes/undo_related_timing_tests.py @@ -8,16 +8,16 @@ $Id$ # not all of these are needed, perhaps: from cPickle import dump, load, HIGHEST_PROTOCOL import foundation.env as env -from debug import register_debug_menu_command, register_debug_menu_command_maker +from utilities.debug import register_debug_menu_command, register_debug_menu_command_maker ###@@@ don't put all those commands in there -- use a submenu, use atom-debug, # or let them only show up if a related flag is set, or so... from PyQt4.Qt import SIGNAL, QObject, QWidget #k ok to do these imports at toplevel? I hope so, since we need them in several places. -from constants import genKey, noop +from utilities.constants import genKey, noop from utilities import debug_flags # for atom_debug [bruce 060128, suggested by Mark; # if this works, we should simplify some defs which worry if it's too early for this] -from debug import call_func_with_timing_histmsg +from utilities.debug import call_func_with_timing_histmsg def atpos_list(part): "Return a list of atom-position arrays, one per chunk in part. Warning: might include shared mutable arrays." diff --git a/cad/src/outtakes/widget_hacks.py b/cad/src/outtakes/widget_hacks.py index 745fa6d21..2dd32dc7e 100755 --- a/cad/src/outtakes/widget_hacks.py +++ b/cad/src/outtakes/widget_hacks.py @@ -93,7 +93,7 @@ def hack_QToolButton_1(qtoolbutton): #bruce 050729 experiment to work around QTo return # return early iconset = qtoolbutton.iconSet() ## Qt4 error: AttributeError: iconSet - from debug_prefs import modify_iconset_On_states + from utilities.debug_prefs import modify_iconset_On_states modify_iconset_On_states(iconset, use_color = toolbutton_highlight_color ) qtoolbutton.setIcon(iconset) #k might not be needed return diff --git a/cad/src/PlatformDependent.py b/cad/src/platform/PlatformDependent.py index 6abe86485..246e7a196 100755 --- a/cad/src/PlatformDependent.py +++ b/cad/src/platform/PlatformDependent.py @@ -24,8 +24,8 @@ import sys, os, time from PyQt4.Qt import Qt, QDesktopWidget, QRect import foundation.env as env from utilities import debug_flags -from debug import print_compact_traceback -from debug import print_compact_stack +from utilities.debug import print_compact_traceback +from utilities.debug import print_compact_stack from utilities.Log import redmsg # == constants (or variables settable by a debugger) read by code in other modules diff --git a/cad/src/platform/__init__.py b/cad/src/platform/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/cad/src/platform/__init__.py diff --git a/cad/src/gpl_only.py b/cad/src/platform/gpl_only.py index 784f56b3e..784f56b3e 100755 --- a/cad/src/gpl_only.py +++ b/cad/src/platform/gpl_only.py diff --git a/cad/src/Plugins.py b/cad/src/processes/Plugins.py index 965dc381d..72e272aa4 100644 --- a/cad/src/Plugins.py +++ b/cad/src/processes/Plugins.py @@ -23,7 +23,7 @@ the user maintain info needed to run external processes. import foundation.env as env import os from PyQt4.Qt import QMessageBox -from Process import Process +from processes.Process import Process def _dialogToOfferPluginPrefsFixup(caption, text): """ diff --git a/cad/src/Process.py b/cad/src/processes/Process.py index 579f8603d..579f8603d 100755 --- a/cad/src/Process.py +++ b/cad/src/processes/Process.py diff --git a/cad/src/ServerManager.py b/cad/src/processes/ServerManager.py index abf007d10..97e5127bb 100755 --- a/cad/src/ServerManager.py +++ b/cad/src/processes/ServerManager.py @@ -9,14 +9,14 @@ Unclear whether or not this is GAMESS-specific. @copyright: 2005-2007 Nanorex, Inc. See LICENSE file for details. """ -from ServerManagerDialog import Ui_ServerManagerDialog +from processes.ServerManagerDialog import Ui_ServerManagerDialog from PyQt4.Qt import QDialog, QStringList, SIGNAL, QMessageBox -from SimServer import SimServer +from simulation.SimServer import SimServer import os import cPickle as pickle -from debug import print_compact_stack -from qt4transition import qt4todo -from PlatformDependent import find_or_make_Nanorex_directory +from utilities.debug import print_compact_stack +from utilities.qt4transition import qt4todo +from platform.PlatformDependent import find_or_make_Nanorex_directory class ServerManager(QDialog, Ui_ServerManagerDialog): """ diff --git a/cad/src/ServerManagerDialog.py b/cad/src/processes/ServerManagerDialog.py index a40c7e955..a40c7e955 100755 --- a/cad/src/ServerManagerDialog.py +++ b/cad/src/processes/ServerManagerDialog.py diff --git a/cad/src/ServerManagerDialog.ui b/cad/src/processes/ServerManagerDialog.ui index de1da2215..de1da2215 100755 --- a/cad/src/ServerManagerDialog.ui +++ b/cad/src/processes/ServerManagerDialog.ui diff --git a/cad/src/processes/__init__.py b/cad/src/processes/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/cad/src/processes/__init__.py diff --git a/cad/src/prototype/__init__.py b/cad/src/prototype/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/cad/src/prototype/__init__.py diff --git a/cad/src/example_expr_command.py b/cad/src/prototype/example_expr_command.py index b7b231ed7..afec21a56 100644 --- a/cad/src/example_expr_command.py +++ b/cad/src/prototype/example_expr_command.py @@ -16,7 +16,7 @@ in which it was called ExampleCommand2E # == PM class -from test_command_PMs import ExampleCommand2_PM +from prototype.test_command_PMs import ExampleCommand2_PM from PM.PM_LineEdit import PM_LineEdit from PM.PM_GroupBox import PM_GroupBox @@ -59,7 +59,7 @@ class ExampleCommand2E_PM( ExampleCommand2_PM ): # these imports are not needed in a minimal example like ExampleCommand2: from graphics.drawing.drawer import drawline -from constants import red +from utilities.constants import red from geometry.VQT import V from exprs.instance_helpers import get_glpane_InstanceHolder from exprs.draggable import DraggablyBoxed @@ -73,7 +73,7 @@ class TextState(InstanceMacro): # rename? _value = TextRect(text) # need size? pass -from test_commands import ExampleCommand2 +from prototype.test_commands import ExampleCommand2 ##from selectAtomsMode import selectAtomsMode ##from commands.SelectAtoms.SelectAtoms_Command import SelectAtoms_Command # used indirectly via ExampleCommand2 diff --git a/cad/src/test_command_PMs.py b/cad/src/prototype/test_command_PMs.py index 170c999ba..170c999ba 100755 --- a/cad/src/test_command_PMs.py +++ b/cad/src/prototype/test_command_PMs.py diff --git a/cad/src/test_commands.py b/cad/src/prototype/test_commands.py index a6465545e..cb4d64330 100755 --- a/cad/src/test_commands.py +++ b/cad/src/prototype/test_commands.py @@ -40,8 +40,8 @@ When cleaning up PropMgrBaseClass etc, note some other things Mark wants to work Fix problems with Example_TemporaryCommand_useParentPM (commented where it's used) """ -from test_command_PMs import ExampleCommand1_PM -from test_command_PMs import ExampleCommand2_PM +from prototype.test_command_PMs import ExampleCommand1_PM +from prototype.test_command_PMs import ExampleCommand2_PM from PM.PM_WidgetsDemoPropertyManager import PM_WidgetsDemoPropertyManager diff --git a/cad/src/test_commands_init.py b/cad/src/prototype/test_commands_init.py index 129d88b50..3b3293751 100755 --- a/cad/src/test_commands_init.py +++ b/cad/src/prototype/test_commands_init.py @@ -9,9 +9,9 @@ How to run these test commands: see test_commands.py docstring. This is initialized in startup_misc.py as of 071030. """ -from debug import register_debug_menu_command +from utilities.debug import register_debug_menu_command -import EndUser, Initialize +import utilities.EndUser as EndUser, utilities.Initialize as Initialize # == @@ -74,18 +74,18 @@ def enter_example_command(widget, example_command_classname): glpane._reinit_modes() # try to avoid problems with changing to other modes later, caused by those reloads # wrong: uses old classes from glpane - import test_command_PMs + import prototype.test_command_PMs as test_command_PMs reload(test_command_PMs) Initialize.forgetInitialization(__name__) - import test_commands_init + import prototype.test_commands_init as test_commands_init reload(test_commands_init) test_commands_init.initialize() # (note: reload code is untested since the change [bruce 071030] # to call initialize explicitly rather than as import side effect, # done together with splitting this module out of test_commands) - from test_commands_init import enter_example_command_doit + from prototype.test_commands_init import enter_example_command_doit else: - from test_commands_init import enter_example_command_doit + from prototype.test_commands_init import enter_example_command_doit enter_example_command_doit(glpane, example_command_classname) return @@ -111,19 +111,19 @@ def initialize(): classnames = [ ] # extended below global ExampleCommand1 - from test_commands import ExampleCommand1 + from prototype.test_commands import ExampleCommand1 classnames.append("ExampleCommand1") global ExampleCommand2 - from test_commands import ExampleCommand2 + from prototype.test_commands import ExampleCommand2 classnames.append("ExampleCommand2") global test_connectWithState - from test_connectWithState import test_connectWithState + from prototype.test_connectWithState import test_connectWithState classnames.append("test_connectWithState") global ExampleCommand2E - from example_expr_command import ExampleCommand2E + from prototype.example_expr_command import ExampleCommand2E classnames.append("ExampleCommand2E") for classname in classnames: diff --git a/cad/src/test_connectWithState.py b/cad/src/prototype/test_connectWithState.py index a07357d9e..8342cce2a 100644 --- a/cad/src/test_connectWithState.py +++ b/cad/src/prototype/test_connectWithState.py @@ -10,10 +10,10 @@ History: 070830 bruce split this out of test_commands.py """ -from test_connectWithState_constants import CYLINDER_HEIGHT_PREFS_KEY, CYLINDER_HEIGHT_DEFAULT_VALUE -from test_connectWithState_constants import cylinder_round_caps +from prototype.test_connectWithState_constants import CYLINDER_HEIGHT_PREFS_KEY, CYLINDER_HEIGHT_DEFAULT_VALUE +from prototype.test_connectWithState_constants import cylinder_round_caps ##from test_connectWithState_constants import CYLINDER_VERTICAL_DEFAULT_VALUE -from test_connectWithState_constants import CYLINDER_WIDTH_DEFAULT_VALUE +from prototype.test_connectWithState_constants import CYLINDER_WIDTH_DEFAULT_VALUE ### better to define here... ### REVISE ### REVISE: the default value should come from the stateref, when using the State macro, @@ -46,17 +46,17 @@ def set_cylinder_height(val): # === PM class -from test_connectWithState_PM import test_connectWithState_PM +from prototype.test_connectWithState_PM import test_connectWithState_PM # === GraphicsMode and Command classes -from test_commands import ExampleCommand +from prototype.test_commands import ExampleCommand from geometry.VQT import V from geometry.VQT import cross -from constants import pink, white +from utilities.constants import pink, white # TODO: import the following from somewhere DX = V(1,0,0) DY = V(0,1,0) @@ -75,7 +75,7 @@ from exprs.Rect import Rect # used to make our drag handle appearance from exprs.DraggableHandle import DraggableHandle_AlongLine from exprs.If_expr import If_expr -from prefs_widgets import ObjAttr_StateRef +from widgets.prefs_widgets import ObjAttr_StateRef class State_preMixin( IorE_guest_mixin): # TODO: refile (alongside IorE_guest_mixin ? in its own file?), once cleaned up & bugfixed -- diff --git a/cad/src/test_connectWithState_PM.py b/cad/src/prototype/test_connectWithState_PM.py index 414ac698e..7f7f2bfa8 100644 --- a/cad/src/test_connectWithState_PM.py +++ b/cad/src/prototype/test_connectWithState_PM.py @@ -20,16 +20,16 @@ History: # and we'll also optimize the State macro and make it easier to use. -from prefs_widgets import Preferences_StateRef, Preferences_StateRef_double # TODO: remove these imports, get the refs from the model +from widgets.prefs_widgets import Preferences_StateRef, Preferences_StateRef_double # TODO: remove these imports, get the refs from the model -from prefs_widgets import ObjAttr_StateRef # TODO: shorter or clearer name -- attribute_ref ? +from widgets.prefs_widgets import ObjAttr_StateRef # TODO: shorter or clearer name -- attribute_ref ? -from test_connectWithState_constants import CYLINDER_HEIGHT_PREFS_KEY, CYLINDER_HEIGHT_DEFAULT_VALUE -from test_connectWithState_constants import CYLINDER_ROUND_CAPS_PREFS_KEY, CYLINDER_ROUND_CAPS_DEFAULT_VALUE # TODO: get prefs refs from model so these are not needed here +from prototype.test_connectWithState_constants import CYLINDER_HEIGHT_PREFS_KEY, CYLINDER_HEIGHT_DEFAULT_VALUE +from prototype.test_connectWithState_constants import CYLINDER_ROUND_CAPS_PREFS_KEY, CYLINDER_ROUND_CAPS_DEFAULT_VALUE # TODO: get prefs refs from model so these are not needed here ##from test_connectWithState_constants import CYLINDER_VERTICAL_DEFAULT_VALUE ##from test_connectWithState_constants import CYLINDER_WIDTH_DEFAULT_VALUE -from test_command_PMs import ExampleCommand1_PM +from prototype.test_command_PMs import ExampleCommand1_PM from PM.PM_GroupBox import PM_GroupBox from PM.PM_DoubleSpinBox import PM_DoubleSpinBox diff --git a/cad/src/test_connectWithState_constants.py b/cad/src/prototype/test_connectWithState_constants.py index ec73e9cf7..ec73e9cf7 100644 --- a/cad/src/test_connectWithState_constants.py +++ b/cad/src/prototype/test_connectWithState_constants.py diff --git a/cad/src/scratch/DirView.py b/cad/src/scratch/DirView.py index e457f4e8f..580c3e43b 100755 --- a/cad/src/scratch/DirView.py +++ b/cad/src/scratch/DirView.py @@ -32,7 +32,7 @@ from PyQt4.Qt import QSize from PyQt4.Qt import QDir from PyQt4.Qt import QApplication -from qt4transition import qt4todo +from utilities.qt4transition import qt4todo folder_closed_image =[ "16 16 9 1", diff --git a/cad/src/scratch/api_enforcement.py b/cad/src/scratch/api_enforcement.py index 168c20b50..29f7eb32c 100644 --- a/cad/src/scratch/api_enforcement.py +++ b/cad/src/scratch/api_enforcement.py @@ -18,7 +18,7 @@ Bruce 071107 split it from debug.py into this scratch file. # REVIEW: might require some imports from debug.py import sys, os, time, types, traceback -from constants import noop +from utilities.constants import noop import foundation.env as env from utilities import debug_flags diff --git a/cad/src/scratch/canvas-b-3.py b/cad/src/scratch/canvas-b-3.py index 0705ba3eb..e93deec5f 100755 --- a/cad/src/scratch/canvas-b-3.py +++ b/cad/src/scratch/canvas-b-3.py @@ -34,7 +34,7 @@ import random import time #bruce try: - from debug import print_compact_stack + from utilities.debug import print_compact_stack except: print "could not import print_compact_stack" def print_compact_stack(msg): diff --git a/cad/src/GROMACS.py b/cad/src/simulation/GROMACS/GROMACS.py index ebe193b0f..77a984dba 100755 --- a/cad/src/GROMACS.py +++ b/cad/src/simulation/GROMACS/GROMACS.py @@ -83,7 +83,7 @@ class GROMACS: # Create a unique directory under the Nanorex/SimFiles directory for our # files: Nanorex/SimFiles/GMX-<timestamp> # - from PlatformDependent import find_or_make_Nanorex_subdir + from platform.PlatformDependent import find_or_make_Nanorex_subdir simFilesPath = find_or_make_Nanorex_subdir('SimFiles') timestamp = datetime.today() self.tempFilePath = \ diff --git a/cad/src/simulation/GROMACS/__init__.py b/cad/src/simulation/GROMACS/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/cad/src/simulation/GROMACS/__init__.py diff --git a/cad/src/PyrexSimulator.py b/cad/src/simulation/PyrexSimulator.py index 0fc794cbe..6817cc09a 100644 --- a/cad/src/PyrexSimulator.py +++ b/cad/src/simulation/PyrexSimulator.py @@ -11,7 +11,7 @@ src/sim/globals.c. import os import foundation.env as env -from PlatformDependent import find_plugin_dir +from platform.PlatformDependent import find_plugin_dir _thePyrexSimulator = None diff --git a/cad/src/SimJob.py b/cad/src/simulation/SimJob.py index 6b99bf641..6b99bf641 100755 --- a/cad/src/SimJob.py +++ b/cad/src/simulation/SimJob.py diff --git a/cad/src/SimServer.py b/cad/src/simulation/SimServer.py index 40732cef9..40732cef9 100755 --- a/cad/src/SimServer.py +++ b/cad/src/simulation/SimServer.py diff --git a/cad/src/SimSetup.py b/cad/src/simulation/SimSetup.py index 947c9bbda..3f89b135e 100755 --- a/cad/src/SimSetup.py +++ b/cad/src/simulation/SimSetup.py @@ -28,14 +28,14 @@ from PyQt4.Qt import SIGNAL import foundation.env as env -from SimSetupDialog import Ui_SimSetupDialog -from movie import Movie -from debug import print_compact_traceback -from prefs_widgets import connect_checkbox_with_boolean_pref -from prefs_constants import Potential_energy_tracefile_prefs_key -from prefs_constants import electrostaticsForDnaDuringDynamics_prefs_key -from debug_prefs import debug_pref, Choice_boolean_False -from qt4transition import qt4todo +from simulation.SimSetupDialog import Ui_SimSetupDialog +from simulation.movie import Movie +from utilities.debug import print_compact_traceback +from widgets.prefs_widgets import connect_checkbox_with_boolean_pref +from utilities.prefs_constants import Potential_energy_tracefile_prefs_key +from utilities.prefs_constants import electrostaticsForDnaDuringDynamics_prefs_key +from utilities.debug_prefs import debug_pref, Choice_boolean_False +from utilities.qt4transition import qt4todo # class FakeMovie: # @@ -170,7 +170,7 @@ class SimSetup(QDialog, Ui_SimSetupDialog): # before 050325 this class was calle try: #bruce 060705 use new common code, if it works - from widget_controllers import realtime_update_controller + from widgets.widget_controllers import realtime_update_controller self.ruc = realtime_update_controller( ( self.update_btngrp_group, self.update_number_spinbox, self.update_units_combobox ), self.watch_motion_checkbox @@ -205,7 +205,7 @@ class SimSetup(QDialog, Ui_SimSetupDialog): # before 050325 this class was calle # # Brian Helfrich 2007-04-06 # - from GROMACS import GROMACS + from simulation.GROMACS.GROMACS import GROMACS gmx = GROMACS(self.assy.part) gmx.run("md") diff --git a/cad/src/SimSetupDialog.py b/cad/src/simulation/SimSetupDialog.py index 602bfab63..602bfab63 100755 --- a/cad/src/SimSetupDialog.py +++ b/cad/src/simulation/SimSetupDialog.py diff --git a/cad/src/SimSetupDialog.ui b/cad/src/simulation/SimSetupDialog.ui index 07250fe47..07250fe47 100755 --- a/cad/src/SimSetupDialog.ui +++ b/cad/src/simulation/SimSetupDialog.ui diff --git a/cad/src/simulation/__init__.py b/cad/src/simulation/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/cad/src/simulation/__init__.py diff --git a/cad/src/movie.py b/cad/src/simulation/movie.py index a22aedbac..2973957b1 100755 --- a/cad/src/movie.py +++ b/cad/src/simulation/movie.py @@ -20,8 +20,8 @@ from utilities.Log import redmsg, orangemsg, greenmsg from geometry.VQT import A from model.chem import move_alist_and_snuggle from utilities import debug_flags -from PlatformDependent import fix_plurals -from debug import print_compact_stack, print_compact_traceback +from platform.PlatformDependent import fix_plurals +from utilities.debug import print_compact_stack, print_compact_traceback from files.dpb_trajectory.moviefile import MovieFile #e might be renamed, creation API revised, etc import foundation.env as env diff --git a/cad/src/runSim.py b/cad/src/simulation/runSim.py index a5e7ebcb2..7218cb497 100755 --- a/cad/src/runSim.py +++ b/cad/src/simulation/runSim.py @@ -27,24 +27,24 @@ simulator executable command-line flag is hardcoded. bruce 051231 partly-done code for using pyrex interface to sim; see use_dylib """ -from debug import print_compact_traceback -import DebugMenuMixin +from utilities.debug import print_compact_traceback +import widgets.DebugMenuMixin as DebugMenuMixin #from DebugMenuMixin import sim_params_set # DebugMenuMixin needs refactoring # to move this variable (sim_params_set) (and related code?) out of it; # see its module docstring for more info [bruce 080104 comment] from utilities import debug_flags -from PlatformDependent import fix_plurals -from PlatformDependent import find_or_make_Nanorex_subdir -from PlatformDependent import hhmmss_str -from PlatformDependent import find_plugin_dir +from platform.PlatformDependent import fix_plurals +from platform.PlatformDependent import find_or_make_Nanorex_subdir +from platform.PlatformDependent import hhmmss_str +from platform.PlatformDependent import find_plugin_dir import os, sys, time from math import sqrt from time import sleep from datetime import datetime -from SimSetup import SimSetup +from simulation.SimSetup import SimSetup from PyQt4.Qt import QApplication, QCursor, Qt, QStringList from PyQt4.Qt import QProcess, QObject, QFileInfo, SIGNAL -from movie import Movie +from simulation.movie import Movie from utilities.Log import redmsg, greenmsg, orangemsg, quote_html, _graymsg import foundation.env as env from foundation.env import seen_before @@ -52,26 +52,26 @@ from geometry.VQT import A import re from model.chem import AtomDict from model.chunk import Chunk -from debug_prefs import debug_pref, Choice, Choice_boolean_True, Choice_boolean_False -from constants import filesplit -from Process import Process -from Plugins import checkPluginPreferences -from StatusBar import AbortHandler, FileSizeProgressReporter -from PyrexSimulator import thePyrexSimulator - -from prefs_constants import electrostaticsForDnaDuringAdjust_prefs_key -from prefs_constants import electrostaticsForDnaDuringMinimize_prefs_key -from prefs_constants import electrostaticsForDnaDuringDynamics_prefs_key -from prefs_constants import Adjust_minimizationEngine_prefs_key - -from prefs_constants import gromacs_enabled_prefs_key -from prefs_constants import gromacs_path_prefs_key -from prefs_constants import cpp_enabled_prefs_key -from prefs_constants import cpp_path_prefs_key - -from prefs_constants import MINIMIZE_ENGINE_UNSPECIFIED -from prefs_constants import MINIMIZE_ENGINE_GROMACS_FOREGROUND -from prefs_constants import MINIMIZE_ENGINE_GROMACS_BACKGROUND +from utilities.debug_prefs import debug_pref, Choice, Choice_boolean_True, Choice_boolean_False +from utilities.constants import filesplit +from processes.Process import Process +from processes.Plugins import checkPluginPreferences +from widgets.StatusBar import AbortHandler, FileSizeProgressReporter +from simulation.PyrexSimulator import thePyrexSimulator + +from utilities.prefs_constants import electrostaticsForDnaDuringAdjust_prefs_key +from utilities.prefs_constants import electrostaticsForDnaDuringMinimize_prefs_key +from utilities.prefs_constants import electrostaticsForDnaDuringDynamics_prefs_key +from utilities.prefs_constants import Adjust_minimizationEngine_prefs_key + +from utilities.prefs_constants import gromacs_enabled_prefs_key +from utilities.prefs_constants import gromacs_path_prefs_key +from utilities.prefs_constants import cpp_enabled_prefs_key +from utilities.prefs_constants import cpp_path_prefs_key + +from utilities.prefs_constants import MINIMIZE_ENGINE_UNSPECIFIED +from utilities.prefs_constants import MINIMIZE_ENGINE_GROMACS_FOREGROUND +from utilities.prefs_constants import MINIMIZE_ENGINE_GROMACS_BACKGROUND # more imports lower down @@ -1005,10 +1005,10 @@ class SimRunner: # we'll probably use different prefs keys depending on an arg that tells us which command-class to use, # Adjust, Minimize, or Adjust Atoms; maybe some function in prefs_constants will return the prefs_key, # so all the UI code can call it too. [bruce 060705] - from prefs_constants import Adjust_endRMS_prefs_key, Adjust_endMax_prefs_key - from prefs_constants import Adjust_cutoverRMS_prefs_key, Adjust_cutoverMax_prefs_key - from prefs_constants import Minimize_endRMS_prefs_key, Minimize_endMax_prefs_key - from prefs_constants import Minimize_cutoverRMS_prefs_key, Minimize_cutoverMax_prefs_key + from utilities.prefs_constants import Adjust_endRMS_prefs_key, Adjust_endMax_prefs_key + from utilities.prefs_constants import Adjust_cutoverRMS_prefs_key, Adjust_cutoverMax_prefs_key + from utilities.prefs_constants import Minimize_endRMS_prefs_key, Minimize_endMax_prefs_key + from utilities.prefs_constants import Minimize_cutoverRMS_prefs_key, Minimize_cutoverMax_prefs_key # kluge for A8 -- ideally these prefs keys or their prefs values # would be set as movie object attrs like all other sim params @@ -2401,7 +2401,7 @@ class Minimize_CommandRun(CommandRun): env.history.message( msg) return elif cmdtype == LOCAL_MIN: - from ops_select import selection_from_atomlist + from operations.ops_select import selection_from_atomlist junk, atomlist, ntimes_expand = self.args selection = selection_from_atomlist( self.part, atomlist) #e in cleaned up code, selection object might come from outside selection.expand_atomset(ntimes = ntimes_expand) # ok if ntimes == 0 @@ -2592,9 +2592,9 @@ class Minimize_CommandRun(CommandRun): # Just get the values from the General Prefs page. # But at least try to do that using new common code. try: - from widget_controllers import realtime_update_controller + from widgets.widget_controllers import realtime_update_controller userPrefs = env.mainwindow().userPrefs - from prefs_constants import Adjust_watchRealtimeMinimization_prefs_key ###@@@ should depend on command, or be in movie... + from utilities.prefs_constants import Adjust_watchRealtimeMinimization_prefs_key ###@@@ should depend on command, or be in movie... ruc = realtime_update_controller( ( userPrefs.update_btngrp_group, ###k name userPrefs.update_number_spinbox, userPrefs.update_units_combobox ), diff --git a/cad/src/Sponsors.py b/cad/src/sponsors/Sponsors.py index add8436dd..a9209a5b3 100755 --- a/cad/src/Sponsors.py +++ b/cad/src/sponsors/Sponsors.py @@ -55,15 +55,15 @@ from PyQt4.Qt import SIGNAL import foundation.env as env from utilities import debug_flags -from PlatformDependent import find_or_make_Nanorex_subdir +from platform.PlatformDependent import find_or_make_Nanorex_subdir from foundation.wiki_help import WikiHelpBrowser -from debug import print_compact_stack, print_compact_traceback -from qt4transition import qt4todo -from prefs_constants import sponsor_download_permission_prefs_key -from prefs_constants import sponsor_permanent_permission_prefs_key -from prefs_constants import sponsor_md5_mismatch_flag_key +from utilities.debug import print_compact_stack, print_compact_traceback +from utilities.qt4transition import qt4todo +from utilities.prefs_constants import sponsor_download_permission_prefs_key +from utilities.prefs_constants import sponsor_permanent_permission_prefs_key +from utilities.prefs_constants import sponsor_md5_mismatch_flag_key from utilities.Log import redmsg, orangemsg, greenmsg -from icon_utilities import geticon +from utilities.icon_utilities import geticon _sponsordir = find_or_make_Nanorex_subdir('Sponsors') _sponsors = { } diff --git a/cad/src/sponsors/__init__.py b/cad/src/sponsors/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/cad/src/sponsors/__init__.py diff --git a/cad/src/sponsors.xml b/cad/src/sponsors/sponsors.xml index 411fe3f43..411fe3f43 100755 --- a/cad/src/sponsors.xml +++ b/cad/src/sponsors/sponsors.xml diff --git a/cad/src/LineMode.py b/cad/src/temporary_commands/LineMode.py index 349c3ddeb..120e2fcb0 100644 --- a/cad/src/LineMode.py +++ b/cad/src/temporary_commands/LineMode.py @@ -22,7 +22,7 @@ from commands.Select.Select_Command import Select_Command from commands.Select.Select_GraphicsMode import Select_GraphicsMode from graphics.drawing.drawer import drawline, drawsphere -from constants import black, darkred, blue +from utilities.constants import black, darkred, blue from geometry.VQT import vlen, norm, angleBetween, V, ptonline diff --git a/cad/src/PanMode.py b/cad/src/temporary_commands/PanMode.py index ac145f8e4..e900e46a7 100755 --- a/cad/src/PanMode.py +++ b/cad/src/temporary_commands/PanMode.py @@ -8,7 +8,7 @@ Pan mode functionality. @license: GPL """ -from TemporaryCommand import TemporaryCommand_Overdrawing +from temporary_commands.TemporaryCommand import TemporaryCommand_Overdrawing # == GraphicsMode part diff --git a/cad/src/RotateMode.py b/cad/src/temporary_commands/RotateMode.py index 238f3be4c..f4d113f9e 100755 --- a/cad/src/RotateMode.py +++ b/cad/src/temporary_commands/RotateMode.py @@ -8,7 +8,7 @@ Rotate mode functionality. @license: GPL """ -from TemporaryCommand import TemporaryCommand_Overdrawing +from temporary_commands.TemporaryCommand import TemporaryCommand_Overdrawing # == GraphicsMode part diff --git a/cad/src/TemporaryCommand.py b/cad/src/temporary_commands/TemporaryCommand.py index 18fe454df..18fe454df 100644 --- a/cad/src/TemporaryCommand.py +++ b/cad/src/temporary_commands/TemporaryCommand.py diff --git a/cad/src/ZoomInOutMode.py b/cad/src/temporary_commands/ZoomInOutMode.py index b90d3e6ee..5dcf83c3e 100644 --- a/cad/src/ZoomInOutMode.py +++ b/cad/src/temporary_commands/ZoomInOutMode.py @@ -9,7 +9,7 @@ Zoom in/out mode functionality. """ from Numeric import exp -from TemporaryCommand import TemporaryCommand_Overdrawing +from temporary_commands.TemporaryCommand import TemporaryCommand_Overdrawing # == GraphicsMode part diff --git a/cad/src/ZoomToAreaMode.py b/cad/src/temporary_commands/ZoomToAreaMode.py index 41c060a54..654de921b 100755 --- a/cad/src/ZoomToAreaMode.py +++ b/cad/src/temporary_commands/ZoomToAreaMode.py @@ -29,10 +29,10 @@ from OpenGL.GLU import gluUnProject from geometry.VQT import V, A import graphics.drawing.drawer as drawer -from constants import GL_FAR_Z +from utilities.constants import GL_FAR_Z -from TemporaryCommand import TemporaryCommand_Overdrawing +from temporary_commands.TemporaryCommand import TemporaryCommand_Overdrawing # == the GraphicsMode part diff --git a/cad/src/temporary_commands/__init__.py b/cad/src/temporary_commands/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/cad/src/temporary_commands/__init__.py diff --git a/cad/src/EndUser.py b/cad/src/utilities/EndUser.py index d046b6ed2..d046b6ed2 100755 --- a/cad/src/EndUser.py +++ b/cad/src/utilities/EndUser.py diff --git a/cad/src/GlobalPreferences.py b/cad/src/utilities/GlobalPreferences.py index d084e3fce..999822680 100644 --- a/cad/src/GlobalPreferences.py +++ b/cad/src/utilities/GlobalPreferences.py @@ -15,9 +15,9 @@ the kinds of things in it so far -- bruce 080220 comment] @copyright: 2006-2008 Nanorex, Inc. See LICENSE file for details. """ -from prefs_constants import permit_atom_chunk_coselection_prefs_key -from debug_prefs import debug_pref, Choice_boolean_False ##, Choice_boolean_True -from debug import print_compact_traceback +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 import print_compact_traceback # == diff --git a/cad/src/Initialize.py b/cad/src/utilities/Initialize.py index 9a816af42..9a816af42 100755 --- a/cad/src/Initialize.py +++ b/cad/src/utilities/Initialize.py diff --git a/cad/src/constants.py b/cad/src/utilities/constants.py index 503368568..16db3e64b 100755 --- a/cad/src/constants.py +++ b/cad/src/utilities/constants.py @@ -411,11 +411,8 @@ except: else: import os CAD_SRC_PATH = os.path.dirname(__file__) - assert not CAD_SRC_PATH.endswith("utilities") # this will fail if we - # forget to fix this definition when moving this file into the - # utilities package. When we do, activate the following code: - ## assert os.path.basename(CAD_SRC_PATH) == "utilities" - ## CAD_SRC_PATH = os.path.dirname(CAD_SRC_PATH) + assert os.path.basename(CAD_SRC_PATH) == "utilities" + CAD_SRC_PATH = os.path.dirname(CAD_SRC_PATH) #print "CAD_SRC_PATH = %r" % CAD_SRC_PATH ### REMOVE WHEN WORKS, BEFORE COMMIT # [review: in a built Mac release, CAD_SRC_PATH might be # .../Contents/Resources/Python/site-packages.zip, or a related pathname diff --git a/cad/src/debug.py b/cad/src/utilities/debug.py index 4f402f880..fbd99b0b9 100755 --- a/cad/src/debug.py +++ b/cad/src/utilities/debug.py @@ -32,7 +32,7 @@ Bruce 071107 split out two modules by Will: """ import sys, os, time, traceback -from constants import noop +from utilities.constants import noop import foundation.env as env from utilities import debug_flags @@ -167,7 +167,7 @@ def legally_execfile_in_globals(filename, globals, error_exception = True): execute the python commands in the given file, in this process. """ try: - import gpl_only + import platform.gpl_only as gpl_only except ImportError: msg = "execfile(%r): not allowed in this non-GPL version" % (filename,) print msg #e should be in a dialog too, maybe depending on an optional arg @@ -186,7 +186,7 @@ def legally_exec_command_in_globals( command, globals, error_exception = True ): in this process. """ try: - import gpl_only + import platform.gpl_only as gpl_only except ImportError: msg = "exec is not allowed in this non-GPL version" print msg #e should be in a dialog too, maybe depending on an optional arg @@ -204,7 +204,7 @@ def exec_allowed(): are exec and/or execfile allowed in this version of NE1? """ try: - import gpl_only + import platform.gpl_only as gpl_only except ImportError: return False return True diff --git a/cad/src/debug_prefs.py b/cad/src/utilities/debug_prefs.py index 065820c07..6fb75fed1 100755 --- a/cad/src/debug_prefs.py +++ b/cad/src/utilities/debug_prefs.py @@ -14,8 +14,8 @@ History: By Bruce, 050614 """ -from constants import noop -from constants import black, white, red, green, blue, gray, orange, yellow, magenta, pink +from utilities.constants import noop +from utilities.constants import black, white, red, green, blue, gray, orange, yellow, magenta, pink from utilities.Comparison import same_vals @@ -136,7 +136,7 @@ class Pref: ## don't do this: self._fulfill_call_with_new_value() return def _fulfill_call_with_new_value(self): - from debug import print_compact_traceback # do locally to avoid recursive import problem + from utilities.debug import print_compact_traceback # do locally to avoid recursive import problem func = self.__call_with_new_value_function if func is not None: val = self.current_value() @@ -175,7 +175,7 @@ class Pref: how to do this depends on datatype (#e and someday on other prefs!) """ def newval_receiver_func(newval): - from debug import print_compact_traceback # do locally to avoid recursive import problem + from utilities.debug import print_compact_traceback # do locally to avoid recursive import problem assert self.dtype.legal_value(newval), "illegal value for %r: %r" % (self, newval) ###e change to ask dtype, since most of them won't have a list of values!!! this method is specific to Choice. if self.current_value() == newval: #bruce 060126; revised 060209 to use self.current_value() rather than self.value @@ -196,7 +196,7 @@ class Pref: env.history.message(msg, quote_html = True, color = 'gray') #bruce 060126 new feature for sub in self.subscribers[:]: #bruce 060213 new feature; as of 070613 this also supports the call_with_new_value feature - from debug import print_compact_traceback # do locally to avoid recursive import problem + from utilities.debug import print_compact_traceback # do locally to avoid recursive import problem try: unsub = sub() except: @@ -368,7 +368,7 @@ def submenu_from_name_value_pairs( nameval_pairs, defaultValue = None ): #bruce 080312 revised to use same_vals (2 places) - from debug import print_compact_traceback # do locally to avoid recursive import problem + from utilities.debug import print_compact_traceback # do locally to avoid recursive import problem submenu = [] for name, value in nameval_pairs: text = name diff --git a/cad/src/icon_utilities.py b/cad/src/utilities/icon_utilities.py index 358653f8c..829536718 100644 --- a/cad/src/icon_utilities.py +++ b/cad/src/utilities/icon_utilities.py @@ -26,8 +26,8 @@ as io for now. (Another possibility would be platform.) [bruce 071214] import os, sys from utilities import debug_flags from PyQt4 import QtGui -import Initialize -import EndUser +import utilities.Initialize as Initialize +import utilities.EndUser as EndUser # This is the subdirectory component "ui" at the end of "cad/src/ui", # in which we store most icons and similar image files. diff --git a/cad/src/objectBrowse.py b/cad/src/utilities/objectBrowse.py index 3f4f575d2..3f4f575d2 100644 --- a/cad/src/objectBrowse.py +++ b/cad/src/utilities/objectBrowse.py diff --git a/cad/src/parse_utils.py b/cad/src/utilities/parse_utils.py index dc0636c03..dc0636c03 100755 --- a/cad/src/parse_utils.py +++ b/cad/src/utilities/parse_utils.py diff --git a/cad/src/prefs_constants.py b/cad/src/utilities/prefs_constants.py index 3bc7fb1ef..c0129c43c 100755 --- a/cad/src/prefs_constants.py +++ b/cad/src/utilities/prefs_constants.py @@ -35,9 +35,9 @@ getDefaultWorkingDirectory. ### do no imports that would not be ok for constants.py to do! ### -from constants import yellow, pink, red, black, magenta, mustard -from constants import blue, gray, white, green, lightgray -from constants import ave_colors, diTUBES +from utilities.constants import yellow, pink, red, black, magenta, mustard +from utilities.constants import blue, gray, white, green, lightgray +from utilities.constants import ave_colors, diTUBES import sys, os # for getDefaultWorkingDirectory diff --git a/cad/src/qt4transition.py b/cad/src/utilities/qt4transition.py index e20fce42f..55892a602 100755 --- a/cad/src/qt4transition.py +++ b/cad/src/utilities/qt4transition.py @@ -11,10 +11,10 @@ import sys import traceback import types -import debug_prefs -import debug +import utilities.debug_prefs as debug_prefs +import utilities.debug as debug -from objectBrowse import objectBrowse +from utilities.objectBrowse import objectBrowse __already = { } diff --git a/cad/src/version.py b/cad/src/utilities/version.py index 811957a3c..36f0ea199 100755 --- a/cad/src/version.py +++ b/cad/src/utilities/version.py @@ -50,7 +50,7 @@ Will Ware""" class Version: """ Example usage: - from version import Version + from utilities.version import Version v = Version() print v, v.product, v.authors """ diff --git a/cad/src/DebugMenuMixin.py b/cad/src/widgets/DebugMenuMixin.py index 795705a75..f6e5371de 100644 --- a/cad/src/DebugMenuMixin.py +++ b/cad/src/widgets/DebugMenuMixin.py @@ -33,17 +33,17 @@ from PyQt4.Qt import QFontDialog, QInputDialog import foundation.env as env from utilities import debug_flags -import debug -import debug_prefs +import utilities.debug as debug +import utilities.debug_prefs as debug_prefs from ne1_ui.UserPrefs import save_window_pos_size, load_window_pos_size -from prefs_constants import mainwindow_geometry_prefs_key_prefix -from debug import registered_commands_menuspec -from debug import print_compact_traceback -from debug import debug_timing_test_pycode_from_a_dialog -from debug import debug_run_command -from constants import debugModifiers -from constants import noop +from utilities.prefs_constants import mainwindow_geometry_prefs_key_prefix +from utilities.debug import registered_commands_menuspec +from utilities.debug import print_compact_traceback +from utilities.debug import debug_timing_test_pycode_from_a_dialog +from utilities.debug import debug_run_command +from utilities.constants import debugModifiers +from utilities.constants import noop # enable the undocumented debug menu by default [bruce 040920] @@ -113,7 +113,7 @@ class DebugMenuMixin: version if one is present) or unless it uses it independently from this mixin and wants to be self-contained.] """ - from menu_helpers import makemenu_helper + from widgets.menu_helpers import makemenu_helper return makemenu_helper(self, menu_spec, menu) def debug_menu_items(self): @@ -342,7 +342,7 @@ class DebugMenuMixin: return def _debug_force_sponsor_download(self): - from Sponsors import _force_download + from sponsors.Sponsors import _force_download _force_download() return diff --git a/cad/src/NE1ToolBar.py b/cad/src/widgets/NE1ToolBar.py index 6e604dc3e..6e604dc3e 100755 --- a/cad/src/NE1ToolBar.py +++ b/cad/src/widgets/NE1ToolBar.py diff --git a/cad/src/NE1_QToolBar.py b/cad/src/widgets/NE1_QToolBar.py index bd02dded7..e54a1f60d 100644 --- a/cad/src/NE1_QToolBar.py +++ b/cad/src/widgets/NE1_QToolBar.py @@ -11,8 +11,8 @@ Command Toolbar). from PyQt4 import QtGui from PyQt4.Qt import Qt, QToolBar, SIGNAL -from icon_utilities import getpixmap -from debug import print_compact_stack +from utilities.icon_utilities import getpixmap +from utilities.debug import print_compact_stack DEBUG = False # Do not commit with DEBUG set to True. diff --git a/cad/src/StatusBar.py b/cad/src/widgets/StatusBar.py index 295b6d40d..3e3995d9a 100755 --- a/cad/src/StatusBar.py +++ b/cad/src/widgets/StatusBar.py @@ -32,12 +32,12 @@ Majorly rewritten/refactored by Eric M circa 12/2007 [bruce comment 071228] import os, time from PyQt4.Qt import QProgressBar, QFrame, QToolButton, QIcon, QLabel, SIGNAL, QMessageBox, QStatusBar from utilities import debug_flags -from PlatformDependent import hhmmss_str #bruce 060106 moved that function there +from platform.PlatformDependent import hhmmss_str #bruce 060106 moved that function there import foundation.env as env -from icon_utilities import geticon +from utilities.icon_utilities import geticon from utilities.Log import redmsg #bruce 060208 fix bug in traceback printing re bug 1263 (doesn't fix 1263 itself) -from qt4transition import qt4todo -from debug import print_compact_traceback +from utilities.qt4transition import qt4todo +from utilities.debug import print_compact_traceback class StatusBar(QStatusBar): def __init__(self, win): diff --git a/cad/src/menu_helpers.py b/cad/src/widgets/menu_helpers.py index bfde86ee7..580fe75f7 100644 --- a/cad/src/menu_helpers.py +++ b/cad/src/widgets/menu_helpers.py @@ -72,7 +72,7 @@ def makemenu_helper(widget, menu_spec, menu = None): to which we'll add items; otherwise we create our own QMenu and add items to it. """ - from debug import print_compact_traceback + from utilities.debug import print_compact_traceback import types if menu is None: menu = QMenu(widget) @@ -182,7 +182,7 @@ def insert_command_into_menu(menu, menutext, command, options = (), position = - iconset = option[1] if type(iconset) is types.StringType: filename = iconset - from icon_utilities import imagename_to_pixmap + from utilities.icon_utilities import imagename_to_pixmap iconset = imagename_to_pixmap(filename) if isinstance(iconset, QPixmap): # (this is true for imagename_to_pixmap retval) diff --git a/cad/src/prefs_widgets.py b/cad/src/widgets/prefs_widgets.py index 52d0d2ff1..ea0eb23f1 100755 --- a/cad/src/prefs_widgets.py +++ b/cad/src/widgets/prefs_widgets.py @@ -24,7 +24,7 @@ calling this a "ui/widgets" module without splitting it -- we'll see. """ import foundation.env as env # for env.prefs -from debug import print_compact_traceback +from utilities.debug import print_compact_traceback from foundation.changes import Formula from widgets.widget_helpers import RGBf_to_QColor diff --git a/cad/src/widgets/simple_dialogs.py b/cad/src/widgets/simple_dialogs.py index a894a5d32..8ddc26f5d 100644 --- a/cad/src/widgets/simple_dialogs.py +++ b/cad/src/widgets/simple_dialogs.py @@ -10,7 +10,7 @@ TODO: merge some of them into one function. """ from PyQt4.Qt import QInputDialog, QLineEdit, QDialog -from icon_utilities import geticon +from utilities.icon_utilities import geticon def grab_text_using_dialog( default = "", title = "title", diff --git a/cad/src/widget_controllers.py b/cad/src/widgets/widget_controllers.py index f85125158..41bc12ae8 100755 --- a/cad/src/widget_controllers.py +++ b/cad/src/widgets/widget_controllers.py @@ -16,7 +16,7 @@ widget_controllers.py - miscellaneous widget-controller classes # (can that just be the program env as a whole?) from PyQt4.Qt import QIcon, SIGNAL -from qt4transition import qt4todo +from utilities.qt4transition import qt4todo import foundation.env as env @@ -28,7 +28,7 @@ def _env_imagename_to_QIcon(imagename, _cache = {}): ### to be replaced with env pass ## pixmap_fname = imagename # stub - from icon_utilities import imagename_to_pixmap + from utilities.icon_utilities import imagename_to_pixmap pixmap = imagename_to_pixmap(imagename) pixmap_fname = pixmap # will this arg work too? @@ -167,7 +167,7 @@ class realtime_update_controller: #bruce 060705, consolidate code from runSim.py self.checkbox = checkbox self.checkbox_prefs_key = checkbox_prefs_key if checkbox and checkbox_prefs_key: - from prefs_widgets import connect_checkbox_with_boolean_pref + from widgets.prefs_widgets import connect_checkbox_with_boolean_pref connect_checkbox_with_boolean_pref(checkbox , checkbox_prefs_key) def set_widgets_from_update_data(self, update_data): if update_data: diff --git a/cad/src/widgets/widget_helpers.py b/cad/src/widgets/widget_helpers.py index 9ad7fbc9b..8e5bfb593 100755 --- a/cad/src/widgets/widget_helpers.py +++ b/cad/src/widgets/widget_helpers.py @@ -31,7 +31,7 @@ from PyQt4.Qt import QSize from PyQt4.Qt import QMessageBox -from qt4transition import qt4todo +from utilities.qt4transition import qt4todo # == |