Changeset 0ed400d in sasview


Ignore:
Timestamp:
Sep 6, 2012 3:17:00 PM (12 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
7034fc0
Parents:
82cd844
Message:

more fixes on compiler msg, and license

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/src/sans/perspectives/calculator/model_editor.py

    r82cd844 r0ed400d  
    750750                                                                    func_str) 
    751751                    tr_msg = _compileFile(self.fname) 
    752                     msg = tr_msg.__str__() 
     752                    msg = str(tr_msg.__str__()) 
    753753                    # Compile error 
    754754                    if msg: 
     755                        msg.replace("  ", "\n") 
    755756                        msg +=  "\nCompiling Failed" 
    756                     else: 
    757                         proc = subprocess.Popen(['python','%s'% self.fname], 
    758                                                 bufsize=1, 
    759                                                 stdout=subprocess.PIPE,  
    760                                                 stderr=subprocess.STDOUT, 
    761                                                 universal_newlines=True, 
    762                                                 shell=False) 
    763                         while proc.poll() is None: 
    764                             line = proc.stdout.readline() 
    765                             if line: 
    766                                 #the real code does filtering here 
    767                                 if line.count("Error"): 
    768                                     msg = line.rstrip() 
    769757                else: 
    770758                    msg = "Error: The func(x) must 'return' a value at least.\n" 
     
    775763            msg = "Name exists already." 
    776764        # Prepare for the messagebox 
    777         if not msg: 
    778             if self.base != None: 
    779                 self.base.update_custom_combo() 
    780             msg = "Successful!!!" 
    781             msg += "  " + self._notes 
    782             msg += " Please look for it in the 'Customized Models' box." 
    783             info = 'Info' 
    784             color = 'blue' 
    785         else: 
     765        if self.base != None and not msg: 
     766            self.base.update_custom_combo() 
     767            Model  = None 
     768            exec "from %s import Model"% name  
     769            try: 
     770                Model().run(0.01)  
     771            except: 
     772                msg = "Error " 
     773                _, value, _ = sys.exc_info() 
     774                msg += "in %s:\n%s\n" % (name,  value) 
     775        if msg: 
    786776            info = 'Error' 
    787777            color = 'red'  
     
    792782            except: 
    793783                pass 
    794         self._msg_box.SetLabel(msg) 
     784        else: 
     785            msg = "Successful!!!" 
     786            msg += "  " + self._notes 
     787            msg += " Please look for it in the 'Customized Models' box." 
     788            info = 'Info' 
     789            color = 'blue' 
     790        # Not to display long error msg 
     791        if info == 'Error': 
     792            mss = info 
     793        else: 
     794            mss = msg 
     795        self._msg_box.SetLabel(mss) 
    795796        self._msg_box.SetForegroundColour(color) 
    796797        # Send msg to the top window   
  • sansview/license.txt

    rc329f4d r0ed400d  
    44and is currently being developed as an open source project hosted at SourceForge 
    55and managed by a consortium of scattering facilities.  Participating facilities 
    6 include: The European Spallation Source, ISIS, The Institut Laue Langevin,  
     6include: The University of Maryland, The European Spallation Source, ISIS, The Institut Laue Langevin,  
    77The National Institute of Standards and Technology Center for Neutron Research  
    88and the Oak Ridge National Laboratory Neutron Sciences Directorate. 
    99 
    10 If you use DANSE applications to do scientific research that leads to publication,  
     10If you use this application to do scientific research that leads to publication,  
    1111we ask that you acknowledge the use of the software with the following sentence: 
    1212 
    1313"This work benefited from the use of the SasView application, originally developed under NSF award DMR-0520547."  
    1414 
    15 See the DANSE project web site for license information: 
    16 http://wiki.cacr.caltech.edu/danse/index.php/Main_Page 
    17  
    18 copyright 2009-2011, University of Tennessee 
     15copyright 2009-2011, UTK, UMD, NIST, ORNL, ISIS, ESS, and ILL 
Note: See TracChangeset for help on using the changeset viewer.