generate a config.py file at install time

Bug #1043242 reported by Paolo Borelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-distutils-extra
New
Undecided
Unassigned

Bug Description

It would be nice if we could generate a config.py file at install time when the install prefix is known, the goald would be to avoid code like the one pasted below and make installation in custom prefixes (like the one used by jhbuild) work out of the box without having to manually set env vars for every application.

We already do something like that in gedit-plugins, but it is an autotools based project http://git.gnome.org/browse/gedit-plugins/tree/plugins/gpdefs.py.in

# Detect if we are running from the source dir
if os.path.exists("gnome-clocks.doap"):
    ENV_PATHS = {
        "GNOME_CLOCKS_DATA_PATH": "data/",
        "GNOME_CLOCKS_IMAGE_PATH": "data/",
        "GNOME_CLOCKS_LOCALE_PATH": "locale/",
    }
else:
    ENV_PATHS = {
        "GNOME_CLOCKS_DATA_PATH": "/usr/share/gnome-clocks/",
        "GNOME_CLOCKS_IMAGE_PATH": "/usr/share/gnome-clocks/pixmaps/",
        "GNOME_CLOCKS_LOCALE_PATH": "/usr/share/locale/",
    }

for var, path in ENV_PATHS.iteritems():
    os.environ.setdefault(var, path)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.