Changeset 1237 in products


Ignore:
Timestamp:
Aug 11, 2009 1:17:09 PM (15 years ago)
Author:
koval
Message:

@@pipeline-config form now has more precise comparation of configs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.transmogrifier/branches/plone-2.1/quintagroup.transmogrifier/quintagroup/transmogrifier/configview.py

    r690 r1237  
    2424            expkey = ANNOKEY+'.export' 
    2525            oldconfig = self.getConfig('export') 
    26             if export_config and export_config != oldconfig: 
     26            if export_config and self._configChanged(oldconfig, export_config): 
    2727                self.anno[expkey] = export_config 
    2828                stat.append('updated export') 
     
    3434            impkey = ANNOKEY+'.import' 
    3535            oldconfig = self.getConfig('import') 
    36             if import_config and import_config != oldconfig: 
     36            if import_config and self._configChanged(oldconfig, import_config): 
    3737                self.anno[impkey] = import_config 
    3838                stat.append('updated import') 
     
    5555            return file(fname).read() 
    5656 
     57    def _configChanged(self, old, new): 
     58        """ Compare configs with normalization of line endings. 
     59        """ 
     60        if old == new: 
     61            return False 
     62        if old == new.replace('\r\n', '\n'): 
     63            return False 
     64        if old.strip() == new.replace('\r\n', '\n'): 
     65            return False 
     66        return True 
     67 
    5768    def isDefault(self, type_): 
    5869        key = '%s.%s' % (ANNOKEY, type_) 
Note: See TracChangeset for help on using the changeset viewer.