Ignore:
Timestamp:
03/16/11 15:36:55 (3 years ago)
Author:
jzbontar <jure.zbontar@…>
Branch:
default
Convert:
eb1adee16d30d5751be3bf92c3862a82ef802704
Message:

Module names can contain dots (eq. Orange.evaluation.testing)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/fixes/fix_changed_names.py

    r7752 r7756  
    456456           "orange.MakeRandomIndicesMultiple": "Orange.data.sample.MakeRandomIndicesMultiple", 
    457457           "orange.MakeRandomIndices2": "Orange.data.sample.MakeRandomIndices2", 
    458             
     458 
    459459           } 
    460460 
     461for k, v in MAPPING.items(): 
     462    if k.startswith('orngTest.'): 
     463        orig = k.split('.')[-1] 
     464        new = v.split('.')[-1] 
     465        if orig != new: 
     466            MAPPING['Orange.evaluation.testing.' + orig] = 'Orange.evaluation.testing.' + new 
     467     
    461468     
    462469def build_pattern(mapping=MAPPING): 
     
    476483    def compile_pattern(self): 
    477484        self.PATTERN = build_pattern(self.mapping) 
    478         self._modules_to_change = [key.split(".", 1)[0] for key in self.mapping.keys()] 
     485        self._modules_to_change = [key.rsplit(".", 1)[0] for key in self.mapping.keys()] 
    479486        super(FixChangedNames, self).compile_pattern() 
    480487         
     
    499506        head = results.get("head") 
    500507        tail = results.get("tail") 
    501         module = head[0].value 
    502          
     508        module = ''.join(map(str, head)) 
     509 
    503510        if member and module in self._modules_to_change: 
    504511            node = member[0] 
Note: See TracChangeset for help on using the changeset viewer.