Ecco Pro

A mundane task: updating a config file to retain old settings

I want to have a hand in creating an excellent personal information manager (PIM) that can be a worthy successor to Ecco Pro. So far, running EccoExt (a clever and expansive hack of Ecco Pro) has been a eminently practical solution.   You can download the most recent version of this actively developed extension from the files section of the ecco_pro Yahoo! group.   I would do so regularly but one of the painful problems with unpacking (using unrar) the new files is that there wasn't an updater that would retain the configuration options of the existing setup.  So a mundane but happy-making programming task of this afternoon was to write a Python script to do exact that function, making use of the builtin ConfigParser library.
"""
compare eccoext.ini files

My goal is to edit the new file so that any overlapping values take on the current value

"""
current_file_path = "/private/tmp/14868/C/Program Files/ECCO/eccoext.ini"
new_file_path = "/private/tmp/14868/C/utils/eccoext.ini"
updated_file = "/private/tmp/14868/C/utils/updated_eccoext.ini"

# extract the key value pairs in both files to compare  the two

# http://docs.python.org/library/configparser.html
import ConfigParser

def extract_values(fname):
    # generate a parsed configuration object, set of (section, options)
    config = ConfigParser.SafeConfigParser()
    options_set = set()

    config.read(fname)
    sections = config.sections()
    for section in sections:
        options = config.options(section)
        for option in options:
            #value = config.get(section,option)
            options_set.add((section,option))

    return (config, options_set)

# process current file and new file

(current_config, current_options) = extract_values(current_file_path)
(new_config, new_options) = extract_values(new_file_path)

# what are the overlapping options
overlapping_options = current_options & new_options

# figure out which of the overlapping options are the values different

for (section,option) in overlapping_options:
    current_value = current_config.get(section,option)
    new_value = new_config.get(section,option)
    if current_value != new_value:
        print section, option, current_value, new_value
        new_config.set(section,option,current_value)

# write the updated config file

with open(updated_file, 'wb') as configfile:
    new_config.write(configfile)

Ecco Pro
Python

Comments (0)

Permalink

Which version of pywin32 works with Ecco Pro DDE?

Two programs of which I am aware uses pywin32 (the Python for Windows extension) to access Ecco Pro's DDE interface:  EccoTools and classeccodde.py.  I have found that the current version of pywin32 (v 212) doesn't work, and that the newest version that does work is version 207. (BTW, you can look at all the versions of pywin32 available at sourceforge.)

The problem comes when you try to create a DDE session with the following lines:

import dde
dde.CreateServer().Create('EccoSession')

If you use versions of pywin32 from v 208 up, you get a "The server could not be created" error.

Next steps:  I should report this error to Mark Hammond, the author of pywin32.  I wrote a message about this issue in the Ecco_Pro group to see whether others

Ecco Pro

Comments (2)

Permalink