A collection of classes and commands for automated command line scripting using Python.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

61 lines
1.1 KiB

# Imports
from .centos import centos
from .django import django
from .messages import messages
from .mysql import mysql
from .pgsql import pgsql
from .posix import posix
from .python import python
from .ubuntu import ubuntu
# Exports
__all__ = (
"MAPPINGS",
"merge",
"merge_dictionaries",
)
# Functions
def merge(first: dict, *others) -> dict:
"""Merge all other dictionaries into the first.
:param first: The first dictionary.
:type first: dict
:param others: A list of other dictionaries to be merged.
"""
for d in others:
first = merge_dictionaries(first, d)
return first
def merge_dictionaries(first: dict, second: dict) -> dict:
"""Merge the second dictionary into the first.
:param first: The first dictionary.
:type first: dict
:param second: The second dictionary.
:type second: dict
:rtype: dict
"""
for key, values in second.items():
first[key] = values
return first
# Mappings
MAPPINGS = {
'centos': merge(centos, django, messages, mysql, pgsql, posix, python),
'ubuntu': merge(ubuntu, django, messages, mysql, pgsql, posix, python),
}