Changeset 2df0b74 in sasview for src/sas/plottools/BaseInteractor.py


Ignore:
Timestamp:
Mar 5, 2015 11:17:05 AM (10 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
3477478
Parents:
dca6188
Message:

pylint fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/plottools/BaseInteractor.py

    r79492222 r2df0b74  
    99 
    1010 
    11 class _BaseInteractor: 
     11class _BaseInteractor(object): 
    1212    """ 
    1313    Share some functions between the interface interactor and various layer 
    1414    interactors. 
    15      
     15 
    1616    Individual interactors need the following functions: 
    17      
     17 
    1818        save(ev)  - save the current state for later restore 
    1919        restore() - restore the old state 
     
    2121        moveend(ev) - end the drag event 
    2222        update() - draw the interactors 
    23          
     23 
    2424    The following are provided by the base class: 
    25      
     25 
    2626        connect_markers(markers) - register callbacks for all markers 
    2727        clear_markers() - remove all items in self.markers 
     
    3232        onDrag(ev) - mouse move: calls move() or restore() 
    3333        onKey(ev) - keyboard move: calls move() or restore() 
    34          
     34 
    3535    Interactor attributes: 
    36      
     36 
    3737        base  - model we are operating on 
    3838        axes  - axes holding the interactor 
    3939        color - color of the interactor in non-active state 
    4040        markers - list of handles for the interactor 
    41          
     41 
    4242    """ 
    4343    def __init__(self, base, axes, color='black'): 
     
    4848        self.color = color 
    4949        self.markers = [] 
    50          
     50 
    5151    def clear_markers(self): 
    5252        ''' 
     
    6363        """ 
    6464        pass 
    65      
     65 
    6666    def restore(self, ev): 
    6767        """ 
    6868        """ 
    6969        pass 
    70      
     70 
    7171    def move(self, x, y, ev): 
    7272        """ 
    7373        """ 
    7474        pass 
    75      
     75 
    7676    def moveend(self, ev): 
    7777        """ 
     
    108108        self.base.draw() 
    109109        return True 
    110              
     110 
    111111    def onClick(self, ev): 
    112112        """ 
     
    137137        self.base.update() 
    138138        return True 
    139      
     139 
    140140    def onKey(self, ev): 
    141141        """ 
    142142        Respond to keyboard events.  Arrow keys move the widget.  Escape 
    143143        restores it to the position before the last click. 
    144          
     144 
    145145        Calls move() to update the state.  Calls restore() on escape. 
    146146        """ 
     
    173173        px, py = ax.transData.inverse_xy_tup((x, y)) 
    174174        if nudge: 
    175             nx, ny = ax.transData.xy_tup((px+0.2, py+0.2)) 
     175            nx, ny = ax.transData.xy_tup((px + 0.2, py + 0.2)) 
    176176        else: 
    177             nx, ny = ax.transData.xy_tup((px+1., py+1.)) 
    178         dx, dy = nx-x, ny-y 
     177            nx, ny = ax.transData.xy_tup((px + 1., py + 1.)) 
     178        dx, dy = nx - x, ny - y 
    179179        return dx, dy 
Note: See TracChangeset for help on using the changeset viewer.