Ignore:
Timestamp:
Oct 11, 2018 12:20:56 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1249
Children:
98b9f32
Parents:
67ed543
Message:

improved support for py37 in sasgui

Location:
src/sas/sasgui/perspectives/simulation
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/simulation/ShapeAdapter.py

    r959eb01 r5251ec6  
    8787            self.sim_canvas._model_changed() 
    8888        else: 
    89             raise ValueError, "SimShapeVisitor: Wrong class for visited object" 
     89            raise ValueError("SimShapeVisitor: Wrong class for visited object") 
    9090         
    9191         
     
    115115            self.sim_canvas._model_changed() 
    116116        else: 
    117             raise ValueError, "SimShapeVisitor: Wrong class for visited object" 
     117            raise ValueError("SimShapeVisitor: Wrong class for visited object") 
    118118         
    119119     
     
    130130            shape.accept_update(self) 
    131131        else: 
    132             raise ValueError, "ShapeAdapter: Shape [%s] not in list" % shape.name 
     132            raise ValueError("ShapeAdapter: Shape [%s] not in list" % shape.name) 
    133133 
  • src/sas/sasgui/perspectives/simulation/ShapeParameters.py

    ra1b8fee r5251ec6  
    1010from __future__ import print_function 
    1111 
     12import sys 
     13from copy import deepcopy 
     14 
    1215import wx 
    13 import sys 
    1416import wx.lib.newevent 
    15 from copy import deepcopy 
    16 import SimCanvas 
     17 
     18from . import SimCanvas 
    1719 
    1820(CreateShapeEvent, EVT_ADD_SHAPE) = wx.lib.newevent.NewEvent() 
     
    201203            n = 1 
    202204            self.parameters = [] 
    203             keys = shape.params.keys() 
    204             keys.sort() 
    205              
    206             for item in keys: 
     205             
     206            for item in sorted(shape.params.keys()): 
    207207                if item in ['contrast', 'order']: 
    208208                    continue 
     
    393393                if not tmp==None: 
    394394                    self.current_shape.params[item[0]] = tmp  
    395         except: 
     395        except Exception as exc: 
    396396            print("Could not create") 
    397             print(sys.exc_value) 
     397            print(exc) 
    398398                 
    399399    def _onCreate(self, evt): 
     
    489489            print("NOT YET IMPLMENTED") 
    490490            print("renaming", self.shape_listbox.GetString(indices[0])) 
    491                  
  • src/sas/sasgui/perspectives/simulation/__init__.py

    r959eb01 r5251ec6  
    11PLUGIN_ID = "Simulation plug-in 1.0" 
    2 from simulation import * 
     2from .simulation import * 
  • src/sas/sasgui/perspectives/simulation/simulation.py

    r7432acb r5251ec6  
    1515 
    1616# Application imports 
    17 import SimCanvas 
    18 import ShapeParameters 
    19 import ShapeAdapter 
     17from sas.sascalc.realspace import VolumeCanvas 
     18from sas.sascalc.data_util.calcthread import CalcThread 
    2019from sas.sasgui.guiframe.dataFitting import Data1D 
    21 # Real-space simulation import 
    22 import sas.sascalc.realspace.VolumeCanvas as VolumeCanvas 
    23  
    24 from sas.sascalc.data_util.calcthread import CalcThread 
    2520from sas.guicomm.events import NewPlotEvent, StatusEvent     
     21 
     22from . import SimCanvas 
     23from . import ShapeParameters 
     24from . import ShapeAdapter 
    2625 
    2726logger = logging.getLogger(__name__) 
Note: See TracChangeset for help on using the changeset viewer.