Changeset 89f3b66 in sasview for park_integration/Loader.py


Ignore:
Timestamp:
Oct 19, 2010 9:02:08 PM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
4ddb7a4
Parents:
74b1770
Message:

working pylint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • park_integration/Loader.py

    raa36f96 r89f3b66  
    11# class Loader  to load any king of file 
    2 import wx 
    3 import string,numpy 
     2#import wx 
     3#import string 
     4import numpy 
    45class Load: 
    56    """ 
     
    78    """ 
    89     
    9     def _init_(self,x=None,y=None,dx=None,dy=None): 
     10    def _init_(self, x=None, y=None, dx=None, dy=None): 
    1011        # variable to store loaded values 
    1112        self.x = x 
     
    1516        self.filename = None 
    1617         
    17     def set_filename(self,path=None): 
     18    def set_filename(self, path=None): 
    1819        """ 
    1920        Store path into a variable.If the user doesn't give a path as a parameter a pop-up 
     
    2526        self.filename = path 
    2627        
    27  
    2828    def get_filename(self): 
    2929        """ return the file's path""" 
     
    3333        """ Store the values loaded from file in local variables""" 
    3434        if not self.filename == None: 
    35             input_f =  open(self.filename,'r') 
     35            input_f =  open(self.filename, 'r') 
    3636            buff = input_f.read() 
    3737            lines = buff.split('\n') 
    38             self.x=[] 
    39             self.y=[] 
     38            self.x = [] 
     39            self.y = [] 
    4040            self.dx = []  
    41             self.dy=[] 
     41            self.dy = [] 
    4242            for line in lines: 
    4343                try: 
     
    6464    def get_values(self): 
    6565        """ Return x, y, dx, dy""" 
    66         return self.x,self.y,self.dx,self.dy 
     66        return self.x, self.y, self.dx, self.dy 
    6767     
    68     def load_data(self,data): 
     68    def load_data(self, data): 
    6969        """ Return plottable""" 
    7070        #load data 
     
    7272        data.y = self.y 
    7373        data.dx = self.dx 
    74         data.dy =self.dy 
     74        data.dy = self.dy 
    7575        #Load its View class 
    7676        #plottable.reset_view() 
     
    7878     
    7979if __name__ == "__main__":  
    80     load= Load() 
     80    load = Load() 
    8181    load.set_filename("testdata_line.txt") 
    8282    print load.get_filename()  
Note: See TracChangeset for help on using the changeset viewer.