Ignore:
Timestamp:
1 Jun 2011, 00:52:39 (14 years ago)
Author:
uli
Message:

Remove trailing whitespace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/batching.py

    r6243 r6259  
    2828    # Name used in pages and forms...
    2929    name = u'Non-registered base importer'
    30    
     30
    3131    # Internal name...
    3232    util_name = 'baseimporter'
    33    
     33
    3434    # Items for this processor need an interface with zope.schema fields.
    3535    iface = Interface
    36    
     36
    3737    # The name must be the same as the util_name attribute in order to
    3838    # register this utility correctly.
     
    4141    # Headers needed to locate items...
    4242    location_fields = ['code', 'faculty_code']
    43    
     43
    4444    # A factory with this name must be registered...
    4545    factory_name = 'waeup.Department'
     
    6565                result.append(key)
    6666        return result
    67        
     67
    6868    @property
    6969    def req(self):
     
    8080        return sorted(list(set(
    8181                    self.location_fields + getFields(self.iface).keys())))
    82    
     82
    8383    def getHeaders(self, mode='create'):
    8484        return self.available_fields
     
    107107            result[replacement] = row[key]
    108108        return result
    109        
     109
    110110    def getMapping(self, path, headerfields, mode):
    111111        """Get a mapping from CSV file headerfields to actually used
     
    132132            result[key] = converter
    133133        return result
    134    
     134
    135135    def convertToTypes(self, row, converter_dict):
    136136        """Convert values in given row to destination type.
     
    167167        """
    168168        raise NotImplementedError('method not implemented')
    169    
     169
    170170    def getEntry(self, row, site):
    171171        """Get the parent object for the entry in ``row``.
    172172        """
    173173        raise NotImplementedError('method not implemented')
    174    
     174
    175175    def addEntry(self, obj, row, site):
    176176        """Add the entry given given by ``row`` data.
     
    181181        """Delete entry given by ``row`` data.
    182182        """
    183         raise NotImplementedError('method not implemented')       
     183        raise NotImplementedError('method not implemented')
    184184
    185185    def updateEntry(self, obj, row, site):
     
    226226        writer.writerow(row)
    227227        return
    228    
     228
    229229    def doImport(self, path, headerfields, mode='create', user='Unknown',
    230230                 logger=None):
     
    238238
    239239        temp_dir = tempfile.mkdtemp()
    240        
     240
    241241        (base, ext) = os.path.splitext(path)
    242242        failed_path = os.path.join(temp_dir, "%s.pending%s" % (base, ext))
     
    254254                                         finished_headers)
    255255        finished_writer.writerow(dict([(x,x) for x in finished_headers]))
    256        
     256
    257257        num =0
    258258        num_warns = 0
     
    267267                self.writeFailedRow(failed_writer, raw_row, conv_warnings)
    268268                continue
    269                
     269
    270270            if mode == 'create':
    271271                if not self.parentsExist(row, site):
     
    313313        time_end = time.time()
    314314        timedelta = time_end - time_start
    315        
     315
    316316        self.createLogfile(path, failed_path, num, num_warns, mode, user,
    317317                           timedelta, logger=logger)
Note: See TracChangeset for help on using the changeset viewer.