File: fluoconfig.py

package info (click to toggle)
python-nxtomomill 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,340 kB
  • sloc: python: 17,207; makefile: 15; sh: 3
file content (35 lines) | stat: -rw-r--r-- 948 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# coding: utf-8

"""
Application to create a default configuration file to be used by fluo2nx application.

.. program-output:: nxtomomill fluo-config --help

"""

import argparse
import logging

from nxtomomill.io import TomoFluoConfig

logging.basicConfig(level=logging.INFO)
_logger = logging.getLogger(__name__)


def main(argv):
    """ """
    parser = argparse.ArgumentParser(description="Create a default configuration file")
    parser.add_argument("output_file", help="output .cfg file")
    parser.add_argument(
        "--level",
        "--option-level",
        help="Level of options to embed in the configuration file. Can be 'required' or 'advanced'.",
        default=None,
    )

    options = parser.parse_args(argv[1:])
    if options.level is not None:
        _logger.warning("level option has been removed. Will be ignored")

    configuration = TomoFluoConfig()
    configuration.to_cfg_file(file_path=options.output_file)