pyspc.plotting.config.Config

class pyspc.plotting.config.Config(filename=None)[source]

Bases : OrderedDict

Classe destinée à traiter la configuration des images

filename

Nom du fichier de configuration

Type:

str

__init__(filename=None)[source]

Initialisation de l’instance Config des images

Paramètres:

filename (str) – Nom du fichier de configuration

Methods

__init__([filename])

Initialisation de l'instance Config des images

clear()

convert([functions])

Convertir les valeurs de la configuration

copy()

fromkeys(iterable[, value])

Create a new ordered dictionary with keys from iterable and values set to value.

get(key[, default])

Return the value for key if key is in the dictionary, else default.

items()

Return a set-like object providing a view on the dict's items.

keys()

Return a set-like object providing a view on the dict's keys.

list_sections_options()

Lister les sections et options de la configuration

load()

Lire le fichier de configuration et convertir les éléments

move_to_end(key[, last])

Move an existing element to the end (or beginning if last is false).

pop(key[,default])

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem([last])

Remove and return a (key, value) pair from the dictionary.

read([encoding])

Lire un fichier de configuration

setdefault(key[, default])

Insert key with a value of default if key is not in the dictionary.

update([E, ]**F)

If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

update_config([config, overwrite, strict])

Mettre à jour la configuration à partir d'un dictionnaire

values()

Return an object providing a view on the dict's values.

clear() None.  Remove all items from od.
convert(functions=None)[source]

Convertir les valeurs de la configuration

Paramètres:

functions (dict) – Fonctions de conversion à appliquer - clé : (section, option) - valeur : fonction de conversion

copy() a shallow copy of od
classmethod fromkeys(iterable, value=None)

Create a new ordered dictionary with keys from iterable and values set to value.

get(key, default=None, /)

Return the value for key if key is in the dictionary, else default.

items()

Return a set-like object providing a view on the dict’s items.

keys()

Return a set-like object providing a view on the dict’s keys.

list_sections_options()[source]

Lister les sections et options de la configuration

load()[source]

Lire le fichier de configuration et convertir les éléments

move_to_end(key, last=True)

Move an existing element to the end (or beginning if last is false).

Raise KeyError if the element does not exist.

pop(key[, default]) v, remove specified key and return the corresponding value.

If the key is not found, return the default if given; otherwise, raise a KeyError.

popitem(last=True)

Remove and return a (key, value) pair from the dictionary.

Pairs are returned in LIFO order if last is true or FIFO order if false.

read(encoding='utf-8')[source]

Lire un fichier de configuration

Paramètres:

encoding (str) – Encodage du fichier de configuration “utf-8” par défaut

setdefault(key, default=None)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) None.  Update D from mapping/iterable E and F.

If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

update_config(config=None, overwrite=None, strict=None)[source]

Mettre à jour la configuration à partir d’un dictionnaire

Paramètres:
  • config (dict, Config) – Eléments à mettre à jour. {(section, option) : valeur}

  • overwrite (bool) – Forcer l’écriture si existant, par défaut: True

  • strict (bool) – Ne considérer que les clés existantes, par défaut: True

values()

Return an object providing a view on the dict’s values.