Project

General

Profile

Actions

Feature #12822

closed

more specific about config file behavior

Added by Anchi Cheng almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
06/06/2022
Due date:
% Done:

0%

Estimated time:
Deliverable:

Description

combine=True means sections in the four possible paths are separately used so [global] can be set in different level from [local]. Used in leginon.cfg, leginon_session.cfg and sinedon.cfg.
combine=False means only the last existing config path will be loaded. Used in instruments.cfg and pyami.cfg

Actions #1

Updated by Anchi Cheng almost 2 years ago

  • Description updated (diff)
Actions #2

Updated by Anchi Cheng over 1 year ago

  • Description updated (diff)
  • Status changed from New to Assigned
Actions #3

Updated by Anchi Cheng over 1 year ago

  • Description updated (diff)

Usage example:

/etc/mami/leginon_session.cfg contains application name prefix definition

[app]
prefix: Krios

environment variable LEGINON_CFG_PATH=/home/anchi/test
/home/anchi/test/leginon_session.cfg contains session name prefix definition

[name]
prefix: 1k

The result can be tested with this python command sequence

from pyami import moduleconfig
moduleconfig.getConfigured(config_file='leginon_session.cfg', package='leginon', combined=True)

This should return {'name':{prefix:'1k'},'app':{prefix:'Krios'}}

Actions #4

Updated by Anchi Cheng over 1 year ago

  • Status changed from Assigned to Closed

tested and in use

Actions

Also available in: Atom PDF