O2-DQ User Interface 1.0.0
Loading...
Searching...
No Matches
configGetter.py
Go to the documentation of this file.
1#!/usr/bin/env python
2# PYTHON_ARGCOMPLETE_OK
3# -*- coding: utf-8 -*-
4
5# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
6# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
7# All rights not expressly granted are reserved.
8#
9# This software is distributed under the terms of the GNU General Public
10# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
11#
12# In applying this license CERN does not waive the privileges and immunities
13# granted to it by virtue of its status as an Intergovernmental Organization
14# or submit itself to any jurisdiction.
15
16from .stringOperations import stringToList
17
18
19def configGetter(configuredCommands: dict, selectedArg: str):
20 """This function get parameters from configured argument in CLI
21
22 Args:
23 configuredCommands (dict): All configured arguments in CLI
24 selectedArg (str): Selected argument as args
25
26 Returns:
27 list or str: Get parameters for selected argument
28 """
29 for keyCfg, valueCfg in configuredCommands.items():
30 if valueCfg is not None: # Skipped None types, because can"t iterate in None type
31 if keyCfg == selectedArg:
32 if isinstance(valueCfg, str):
33 return stringToList(valueCfg)
34 else:
35 return valueCfg