Changes in / [27689dc:93c79b5] in sasview


Ignore:
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • installers/installer_generator.py

    • Property mode changed from 100755 to 100644
    r0595bb7 r988deab  
    5555        for item in wild_cards: 
    5656            #['All (*.*)|*.*'] 
    57             file_type, ext = string.split(item, "|*", 1) 
     57            file_type, ext = item.split("|*", 1) 
    5858            if ext.strip() not in ['.*', ''] and ext.strip() not in list_data: 
    5959                list_data.append((ext, 'string', file_type)) 
     
    6161        pass 
    6262    try: 
    63         file_type, ext = string.split(local_config.APPLICATION_WLIST, "|*", 1) 
     63        file_type, ext = local_config.APPLICATION_WLIST.split("|*", 1) 
    6464        if ext.strip() not in ['.', ''] and ext.strip() not in list_app: 
    6565            list_app.append((ext, 'string', file_type)) 
     
    6868    try: 
    6969        for item in local_config.PLUGINS_WLIST: 
    70             file_type, ext = string.split(item, "|*", 1) 
     70            file_type, ext = item.split("|*", 1) 
    7171            if ext.strip() not in ['.', ''] and ext.strip() not in list_app: 
    7272                list_app.append((ext, 'string', file_type)) 
     
    8383    msg = "" 
    8484    if data_extension is not None and data_extension: 
     85        msg = "\n\n[Registry]\n" 
    8586        openwithlist = "OpenWithList\%s" % str(APPLICATION) 
    86         msg = "\n\n[Registry]\n" 
    8787        for (ext, type, _) in data_extension: 
    8888            list = os.path.join(ext, openwithlist) 
     
    192192    return msg 
    193193 
    194 dist_path = "dist" 
     194dist_path = "dist\sasview" 
    195195def write_file(): 
    196196    """ 
     
    200200    msg += """Source: "%s\%s";\t""" % (dist_path, str(APPLICATION)) 
    201201    msg += """DestDir: "{app}";\tFlags: ignoreversion\n""" 
    202     msg += """Source: "dist\*";\tDestDir: "{app}";\t""" 
     202    msg += """Source: "dist\sasview\*";\tDestDir: "{app}";\t""" 
    203203    msg += """Flags: ignoreversion recursesubdirs createallsubdirs\n""" 
    204     msg += """Source: "dist\plugin_models\*";\tDestDir: "{userdesktop}\..\.sasview\plugin_models";\t""" 
     204    msg += """Source: "dist\sasview\plugin_models\*";\tDestDir: "{userdesktop}\..\.sasview\plugin_models";\t""" 
    205205    msg += """Flags: recursesubdirs createallsubdirs\n""" 
    206     msg += """Source: "dist\compiled_models\*";\tDestDir: "{userdesktop}\..\.sasmodels\compiled_models";\t""" 
    207     msg += """Flags: recursesubdirs createallsubdirs\n""" 
    208     msg += """Source: "dist\config\custom_config.py";\tDestDir: "{userdesktop}\..\.sasview\config";\t""" 
     206    msg += """Source: "dist\sasview\custom_config.py";\tDestDir: "{userdesktop}\..\.sasview\config";\t""" 
    209207    msg += """Flags: recursesubdirs createallsubdirs\n""" 
    210208    #msg += """Source: "dist\default_categories.json";    DestDir: "{userdesktop}\..\.sasview";\t""" 
  • run.py

    r4992ff2 ra3221b6  
    151151    logger.debug("Starting SASVIEW in debug mode.") 
    152152    prepare() 
    153     from sas.qtgui.MainWindow.MainWindow import run 
    154     run() 
     153    from sas.qtgui.MainWindow.MainWindow import run_sasview 
     154    run_sasview() 
    155155    logger.debug("Ending SASVIEW in debug mode.") 
  • src/sas/qtgui/MainWindow/MainWindow.py

    r8ac3551 ra3221b6  
    5050    return splashScreen 
    5151 
    52 def run(): 
     52def run_sasview(): 
    5353    app = QApplication([]) 
    5454 
     
    8585 
    8686if __name__ == "__main__": 
    87     run() 
     87    run_sasview() 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    rd6e38661 rded5e77  
    191191        self.is_batch_fitting = False 
    192192        self.is_chain_fitting = False 
     193        # Is the fit job running? 
     194        self.fit_started=False 
     195        # The current fit thread 
     196        self.calc_fit = None 
    193197        # Current SasModel in view 
    194198        self.kernel_module = None 
     
    12001204        Perform fitting on the current data 
    12011205        """ 
     1206        if self.fit_started: 
     1207            self.stopFit() 
     1208            return 
     1209 
    12021210        # initialize fitter constants 
    12031211        fit_id = 0 
     
    12261234        completefn = self.batchFittingCompleted if self.is_batch_fitting else self.fittingCompleted 
    12271235 
    1228         calc_fit = FitThread(handler=handler, 
     1236        self.calc_fit = FitThread(handler=handler, 
    12291237                            fn=fitters, 
    12301238                            batch_inputs=batch_inputs, 
     
    12371245        if LocalConfig.USING_TWISTED: 
    12381246            # start the trhrhread with twisted 
    1239             calc_thread = threads.deferToThread(calc_fit.compute) 
     1247            calc_thread = threads.deferToThread(self.calc_fit.compute) 
    12401248            calc_thread.addCallback(completefn) 
    12411249            calc_thread.addErrback(self.fitFailed) 
    12421250        else: 
    12431251            # Use the old python threads + Queue 
    1244             calc_fit.queue() 
    1245             calc_fit.ready(2.5) 
     1252            self.calc_fit.queue() 
     1253            self.calc_fit.ready(2.5) 
    12461254 
    12471255        self.communicate.statusBarUpdateSignal.emit('Fitting started...') 
     1256        self.fit_started = True 
    12481257        # Disable some elements 
    12491258        self.setFittingStarted() 
    12501259 
     1260    def stopFit(self): 
     1261        """ 
     1262        Attempt to stop the fitting thread 
     1263        """ 
     1264        if self.calc_fit is None or not self.calc_fit.isrunning(): 
     1265            return 
     1266        self.calc_fit.stop() 
     1267        #self.fit_started=False 
     1268        #re-enable the Fit button 
     1269        self.setFittingStopped() 
     1270 
     1271        msg = "Fitting cancelled." 
     1272        self.communicate.statusBarUpdateSignal.emit(msg) 
     1273 
    12511274    def updateFit(self): 
    12521275        """ 
     
    12581281        """ 
    12591282        """ 
    1260         print("FIT FAILED: ", reason) 
    1261         pass 
     1283        self.setFittingStopped() 
     1284        msg = "Fitting failed with: "+ str(reason) 
     1285        self.communicate.statusBarUpdateSignal.emit(msg) 
    12621286 
    12631287    def batchFittingCompleted(self, result): 
     
    13091333 
    13101334        elapsed = result[1] 
    1311         msg = "Fitting completed successfully in: %s s.\n" % GuiUtils.formatNumber(elapsed) 
     1335        if self.calc_fit._interrupting: 
     1336            msg = "Fitting cancelled by user after: %s s." % GuiUtils.formatNumber(elapsed) 
     1337            logging.warning("\n"+msg+"\n") 
     1338        else: 
     1339            msg = "Fitting completed successfully in: %s s." % GuiUtils.formatNumber(elapsed) 
    13121340        self.communicate.statusBarUpdateSignal.emit(msg) 
    13131341 
     
    23862414    def setFittingStarted(self): 
    23872415        """ 
    2388         Set item enablement on fitting start 
    2389         """ 
    2390         #disable the Fit button 
    2391         self.cmdFit.setText('Running...') 
    2392         self.cmdFit.setEnabled(False) 
     2416        Set buttion caption on fitting start 
     2417        """ 
     2418        # Notify the user that fitting is being run 
     2419        # Allow for stopping the job 
     2420        self.cmdFit.setStyleSheet('QPushButton {color: red;}') 
     2421        self.cmdFit.setText('Stop fit') 
    23932422 
    23942423    def setFittingStopped(self): 
    23952424        """ 
    2396         Set item enablement on fitting stop 
    2397         """ 
    2398         #enable the Fit button 
     2425        Set button caption on fitting stop 
     2426        """ 
     2427        # Notify the user that fitting is available 
     2428        self.cmdFit.setStyleSheet('QPushButton {color: black;}') 
    23992429        self.cmdFit.setText("Fit") 
    2400         self.cmdFit.setEnabled(True) 
     2430        self.fit_started = False 
    24012431 
    24022432    def readFitPage(self, fp): 
  • src/sas/qtgui/Utilities/TabbedModelEditor.py

    r3b8cc00 r3b8cc00  
    126126        self.editor_widget.setEnabled(True) 
    127127        self.editor_widget.blockSignals(False) 
    128         self.filename, _ = os.path.splitext(os.path.basename(filename)) 
    129  
    130         self.setWindowTitle(self.window_title + " - " + self.filename) 
     128        self.filename = filename 
     129        display_name, _ = os.path.splitext(os.path.basename(filename)) 
     130 
     131        self.setWindowTitle(self.window_title + " - " + display_name) 
    131132 
    132133    def onModifiedExit(self): 
Note: See TracChangeset for help on using the changeset viewer.