Changeset 4433

Show
Ignore:
Timestamp:
04/04/09 22:39:48 (4 years ago)
Author:
gpolo
Message:

Changed merge_ini.merge signature to match sqlitedb.merge

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/umit/merger/merge_ini.py

    r4417 r4433  
    33import ConfigParser 
    44 
    5 def merge(old_file, new_file): 
     5def merge(from_file, to_file): 
    66    """ 
    7     @old_file: Path to a supposed older ini file 
    8     @new_file: Path to a supposed newer ini file 
     7    @from_file: Path to a supposed newer ini file 
     8    @to_file: Path to a supposed older ini file 
    99    @return true or false 
    1010    """ 
    11     if not os.path.exists(old_file) or not os.path.exists(new_file): 
     11    if not os.path.exists(from_file) or not os.path.exists(to_file): 
    1212        return False 
    1313 
    14     # Backup old file 
    15     shutil.copyfile(old_file, old_file + '.bak') 
     14    # Backup the destination 
     15    shutil.copyfile(to_file, to_file + '.bak') 
    1616 
    1717    # Read new file 
    1818    config_new = ConfigParser.RawConfigParser() 
    19     config_new.read(new_file) 
     19    config_new.read(from_file) 
    2020 
    2121    # Read old file 
    2222    config = ConfigParser.RawConfigParser() 
    23     config.read(old_file) 
     23    config.read(to_file) 
    2424 
    2525    # Merge files 
     
    3636 
    3737    # Write back the merged configuration 
    38     f = open(old_file, 'wb') 
     38    f = open(to_file, 'wb') 
    3939    config.write(f) 
    4040