Project

General

Profile

Actions

Bug #1783

closed

leginon.cfg, sinedon.cfg, and instruments.cfg are often lost when installation changes

Added by Anchi Cheng about 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
-
Start date:
05/04/2012
Due date:
% Done:

0%

Estimated time:
Affected Version:
Appion/Leginon 2.1.0
Show in known bugs:
No
Workaround:

Description

This happens so frequently now since we have three versions of appion processing on three non-totally interactive login systems and two clusters that spread to many nodes. Need a better solution such as searching these as last resort a place on the computer outside the installation.

Any thought where this should be?

If Jim and Sargis can agree on a place, I volunteer to add it in if Jim does not want to. We need it now.

Actions #1

Updated by Jim Pulokas about 12 years ago

  • Status changed from New to In Test
  • Assignee changed from Jim Pulokas to Anchi Cheng

I had sinedon looking in /etc/ for a config file, but I suggest for best organization we have a special directory where we can put any myami configs (leginon,sinedon,etc.):

/etc/myami/

Fixed sinedon to look in /etc/myami/ for a config file: r16611
Fixed leginon to look in /etc/myami/ for config file: r16613

Actions #2

Updated by Jim Pulokas about 12 years ago

r16617: Also pyscope will look for instruments.cfg in /etc/myami/. Unlike the other config parsers, pyscope will not read the config files just by importing the module. To check what config files were successfully read by pyscope, you have to import, then run the parse function, then check, like this:

import pyscope.config
pyscope.config.parse()
pyscope.config.configfiles

Actions #3

Updated by Anchi Cheng about 12 years ago

  • Assignee changed from Anchi Cheng to Jim Pulokas

r16625 commit r16611, r16613, r16617 change from trunk to branch 2.2

tested on my Mac.

Jim, won't '/etc/myami' broken on Windows? Shall we use C:\\Documents and Settings\\All Users\\Documents\\myami' ?

Since the old sinedon.cfg change did not cause Leginon to stop, it might be o.k., although I don't see why.

Actions #4

Updated by Jim Pulokas about 12 years ago

  • Status changed from In Test to In Code Review
  • Assignee changed from Jim Pulokas to Anchi Cheng
r16636 and r16637: A lot going on here:
  • consolidate all determination of config file location into one function in pyami.fileutil
  • use that new function in all other places where a ConfigParser is used
  • Added in special case for Windows (untested)
  • clean up leginon to make it consistent with sinedon and pyscope. config file is no longer in a special config subdir. default.cfg replaced with leginon.cfg.template
  • clean up appion: some modules unnecessary as they are only thin wrappers around sinedon getConfig/setConfig. I think they were only needed many years ago when sinedon was an optional part of appion
Actions #5

Updated by Jim Pulokas almost 12 years ago

r16653 makes all values in leginon.cfg optional. Defaults are set in python code rather than the now removed default.cfg.

Actions #6

Updated by Amber Herold almost 12 years ago

The order in which configs are used:
1. home dir
2. site packages
3. /etc/myami

/leginon/config no longer exists, so the config file should be in /leginon when looking in site packages.

Actions #8

Updated by Anchi Cheng over 11 years ago

  • Status changed from In Code Review to Closed

reviewed. This has been used on my Mac for several months now. consider tested in trunk. Will close for now.

Actions

Also available in: Atom PDF