1717 import wx .lib .scrolledpanel as wxscroll
1818 import wx .lib .resizewidget as rw
1919 interactive = True
20- from .. import GSASIIctrlGUI as G2G
2120except ImportError :
2221 G2G = None
2322 # Avoid wx dependency for Scriptable
@@ -1381,6 +1380,7 @@ def ValidateAscii(self,checklist):
13811380 if msg : msg += '\n '
13821381 msg += lbl + " contains unicode characters: " + val
13831382 if msg :
1383+ from .. import GSASIIctrlGUI as G2G
13841384 G2G .G2MessageBox (self .G2frame ,
13851385 'Error: CIFs can contain only ASCII characters. Please change item(s) below:\n \n ' + msg ,
13861386 'Unicode not valid for CIF' )
@@ -2038,6 +2038,7 @@ def WriteDistances(phasenam):
20382038 if 'DisAglCtls' not in generalData :
20392039 # should not happen, since DisAglDialog should be called
20402040 # for all phases before getting here
2041+ from .. import GSASIIctrlGUI as G2G
20412042 dlg = G2G .DisAglDialog (
20422043 self .G2frame ,
20432044 {},
@@ -3417,6 +3418,7 @@ def WriteSingleXtalData(histlbl):
34173418 def EditAuthor (event = None ):
34183419 'dialog to edit the CIF author info'
34193420 'Edit the CIF author name'
3421+ from .. import GSASIIctrlGUI as G2G
34203422 dlg = G2G .SingleStringDialog (self .G2frame ,
34213423 'Get CIF Author' ,
34223424 'Provide CIF Author name (Last, First)' ,
@@ -3435,6 +3437,7 @@ def EditAuthor(event=None):
34353437
34363438 def EditInstNames (event = None ):
34373439 'Provide a dialog for editing instrument names; for sequential fit, only need one name'
3440+ from .. import GSASIIctrlGUI as G2G
34383441 dictlist = []
34393442 keylist = []
34403443 lbllist = []
@@ -3468,6 +3471,7 @@ def EditRanges(event):
34683471 '''
34693472 but = event .GetEventObject ()
34703473 phasedict = but .phasedict
3474+ from .. import GSASIIctrlGUI as G2G
34713475 dlg = G2G .DisAglDialog (
34723476 self .G2frame ,
34733477 phasedict ['General' ]['DisAglCtls' ], # edited
@@ -3489,6 +3493,7 @@ def EditCIFDefaults():
34893493 '''Fills the CIF Defaults window with controls for editing various CIF export
34903494 parameters (mostly related to templates).
34913495 '''
3496+ from .. import GSASIIctrlGUI as G2G
34923497 if len (self .cifdefs .GetChildren ()) > 0 :
34933498 saveSize = self .cifdefs .GetSize ()
34943499 self .cifdefs .DestroyChildren ()
@@ -3659,6 +3664,7 @@ def _ResetSelT(event):
36593664
36603665 def SelectDisAglFlags (event ):
36613666 'Select Distance/Angle use flags for the selected phase'
3667+ from .. import GSASIIctrlGUI as G2G
36623668 phasenam = event .GetEventObject ().phase
36633669 phasedict = self .Phases [phasenam ]
36643670 SymOpList ,offsetList ,symOpList ,G2oprList ,G2opcodes = G2spc .AllOps (phasedict ['General' ]['SGData' ])
@@ -4059,6 +4065,7 @@ def SelectDisAglFlags(event):
40594065 #i = self.Phases[phasenam]['pId']
40604066 phasedict = self .Phases [phasenam ] # pointer to current phase info
40614067 if 'DisAglCtls' not in phasedict ['General' ]:
4068+ from .. import GSASIIctrlGUI as G2G
40624069 dlg = G2G .DisAglDialog (
40634070 self .G2frame ,
40644071 {},
@@ -4709,6 +4716,7 @@ def __init__(self,G2frame):
47094716 self .author = ''
47104717
47114718 def mergeMag (self ,G2frame ,ChemPhase ,MagPhase ):
4719+ from .. import GSASIIctrlGUI as G2G
47124720 def onChange (* args ,** kwargs ):
47134721 wx .CallLater (100 ,showMergeMag )
47144722 def showMergeMag ():
@@ -5246,6 +5254,7 @@ class EditCIFtemplate(wx.Dialog):
52465254 saving the CIF.
52475255 '''
52485256 def __init__ (self ,parent ,cifblk ,loopstructure ,defaultname ):
5257+ from .. import GSASIIctrlGUI as G2G
52495258 OKbuttons = []
52505259 self .cifblk = cifblk
52515260 self .loopstructure = loopstructure
@@ -5290,6 +5299,7 @@ def Post(self):
52905299 return (self .ShowModal () == wx .ID_OK )
52915300 def _onSave (self ,event ):
52925301 'Save CIF entries in a template file'
5302+ from .. import GSASIIctrlGUI as G2G
52935303 pth = G2G .GetExportPath (self .G2frame )
52945304 dlg = wx .FileDialog (
52955305 self , message = "Save as CIF template" ,
@@ -5334,6 +5344,7 @@ class EditCIFpanel(wxscroll.ScrolledPanel):
53345344 :param (other): optional keyword parameters for wx.ScrolledPanel
53355345 '''
53365346 def __init__ (self , parent , cifblk , loopstructure , cifdic = {}, OKbuttons = [], ** kw ):
5347+ from .. import GSASIIctrlGUI as G2G
53375348 self .parent = parent
53385349 wxscroll .ScrolledPanel .__init__ (self , parent , wx .ID_ANY , ** kw )
53395350 self .vbox = None
@@ -5492,6 +5503,7 @@ def CIFEntryWidget(self,dct,item,dataname):
54925503 numerical values and highlights them as invalid.
54935504 Use a selection widget when there are specific enumerated values for a string.
54945505 '''
5506+ from .. import GSASIIctrlGUI as G2G
54955507 if self .cifdic .get (dataname ):
54965508 if self .cifdic [dataname ].get ('_enumeration' ):
54975509 values = ['?' ]+ self .cifdic [dataname ]['_enumeration' ]
@@ -5648,6 +5660,7 @@ def _onResetTemplate(event):
56485660 self .Add (hbox )
56495661 def _onGetTemplateFile (self ,event ):
56505662 'select a template file'
5663+ from .. import GSASIIctrlGUI as G2G
56515664 pth = G2G .GetImportPath (self .G2frame )
56525665 if not pth : pth = '.'
56535666 dlg = wx .FileDialog (
0 commit comments