@@ -55,9 +55,8 @@ def handleEngineException(error, gui=None):
5555
5656##############################################################################
5757class Fitting (Organizer ):
58- """Fitting is the class to control a PdfFit process, which can be either
59- running on a remote machine or locally. Fitting will start a thread to
60- interact with the PdfFit server using ssh2 and XMLRPC protocol.
58+ """Fitting is the class to control a PdfFit process running locally.
59+ Fitting will start a new thread to interact with the PdfFit server.
6160
6261 rw: fitness parameter
6362 tolerancy: accurancy requirement
@@ -117,8 +116,7 @@ def __init__(self, name):
117116 self .stopped = False
118117 self .paused = False
119118
120- # rpc memeber
121- self .host = None
119+ # the PDFfit2 server instance.
122120 self .server = None
123121
124122 # public data members
@@ -152,12 +150,8 @@ def __changeStatus(self, fitStatus=None, jobStatus=None):
152150
153151 def _release (self ):
154152 """release resources"""
155- if self .host : # is not None (running on a remote server)
156- self .host .releaseServer (self .server )
157- self .host = None
158- else :
159- if self .server : # server has been allocated, we need free the memory
160- self .server .reset ()
153+ if self .server : # server has been allocated, we need free the memory
154+ self .server .reset ()
161155
162156 def _getStrId (self ):
163157 """make a string identifier
@@ -320,16 +314,9 @@ def getServer(self):
320314 """
321315 if self .fitStatus != Fitting .INITIALIZED :
322316 return
323-
324- self .host = self .controlCenter .getHost ()
325- if self .host is None :
326- # import directly from local host
327- from diffpy .pdffit2 import PdfFit
328- self .server = PdfFit ()
329- else :
330- # get server without waiting.
331- self .server = self .host .getServer ()
332-
317+ # create a new instance of calculation server
318+ from diffpy .pdffit2 import PdfFit
319+ self .server = PdfFit ()
333320 self .__changeStatus (fitStatus = Fitting .CONNECTED )
334321
335322
0 commit comments