mirror of
https://github.com/HorlogeSkynet/archey4
synced 2025-04-16 16:00:13 +02:00

`config.json` has been reshuffled so that entries are now represented as a dict with `type` as long as their respective options as keys. + Entries order can be rearranged from configuration (closes #57) + Entries now have an extra `options` attribute, which contains their own settings + Entries can be specified multiple times in the configuration with each one having independent options from the others + Implements temporary entry hiding (`disabled` option field) + Defaults entry `name` attribute to instantiated class name + Allows entry renaming (`name` option field) + Adapts documentation of new configuration layout in README * Various miscellaneous changes to support the new `entry_options` attribute. * `LanIp` and `WanIp` internally renamed to `LanIP` and `WanIP` respectively * Sets `Disk.get_df_output_dict` as private method * Fixes `Raspberry` spelling :) - Stops providing a global `Configuration` reference to entries (only one to `default_strings` for i18n) - Sets `use_unicode` option as `Terminal`-specific - Sets `honor_ansi_color` option as project-global Co-authored-by: Samuel FORESTIER <dev@samuel.domains>
89 lines
3.7 KiB
Python
89 lines
3.7 KiB
Python
"""
|
|
Logos colors definition.
|
|
Distributions / logos correspondences.
|
|
Default configuration.
|
|
"""
|
|
|
|
import archey.logos as logos
|
|
|
|
from archey.colors import Colors
|
|
from archey.distributions import Distributions
|
|
|
|
|
|
# This dictionary contains which colors should be used for each supported distribution.
|
|
# The first element (`[0]`) of each list will be used to display text entries.
|
|
COLORS_DICT = {
|
|
Distributions.ARCH_LINUX: [Colors.CYAN_BRIGHT, Colors.CYAN_NORMAL],
|
|
Distributions.ANDROID: [Colors.GREEN_BRIGHT, Colors.WHITE_BRIGHT],
|
|
Distributions.ALPINE_LINUX: [Colors.BLUE_BRIGHT],
|
|
Distributions.BUNSENLABS: [Colors.WHITE_BRIGHT, Colors.YELLOW_BRIGHT, Colors.YELLOW_NORMAL],
|
|
Distributions.CENTOS: [
|
|
Colors.WHITE_BRIGHT,
|
|
Colors.YELLOW_NORMAL, Colors.GREEN_BRIGHT, Colors.BLUE_NORMAL, Colors.MAGENTA_BRIGHT
|
|
],
|
|
Distributions.CRUNCHBANG: [Colors.WHITE_BRIGHT],
|
|
Distributions.DEBIAN: [Colors.RED_BRIGHT, Colors.RED_NORMAL],
|
|
Distributions.ELEMENTARY: [Colors.WHITE_BRIGHT],
|
|
Distributions.FEDORA: [Colors.BLUE_BRIGHT, Colors.BLUE_NORMAL, Colors.WHITE_BRIGHT],
|
|
Distributions.FREEBSD: [Colors.RED_BRIGHT, Colors.RED_NORMAL],
|
|
Distributions.GENTOO: [Colors.MAGENTA_BRIGHT, Colors.WHITE_BRIGHT],
|
|
Distributions.KALI_LINUX: [Colors.BLUE_BRIGHT, Colors.WHITE_BRIGHT],
|
|
Distributions.MANJARO_LINUX: [Colors.GREEN_BRIGHT],
|
|
Distributions.NIXOS: [Colors.BLUE_NORMAL, Colors.CYAN_NORMAL],
|
|
Distributions.LINUX: [Colors.WHITE_BRIGHT, Colors.YELLOW_BRIGHT],
|
|
Distributions.LINUX_MINT: [Colors.GREEN_BRIGHT, Colors.WHITE_BRIGHT],
|
|
Distributions.POP: [Colors.CYAN_BRIGHT, Colors.WHITE_BRIGHT],
|
|
Distributions.OPENBSD: [Colors.YELLOW_BRIGHT, Colors.WHITE_BRIGHT],
|
|
Distributions.OPENSUSE: [Colors.GREEN_NORMAL, Colors.WHITE_BRIGHT],
|
|
Distributions.RASPBIAN: [Colors.RED_BRIGHT, Colors.GREEN_NORMAL],
|
|
Distributions.RED_HAT: [Colors.RED_BRIGHT, Colors.WHITE_BRIGHT, Colors.RED_NORMAL],
|
|
Distributions.SLACKWARE: [Colors.BLUE_NORMAL, Colors.BLUE_BRIGHT, Colors.CLEAR],
|
|
Distributions.UBUNTU: [Colors.RED_BRIGHT, Colors.WHITE_BRIGHT],
|
|
Distributions.WINDOWS: [
|
|
Colors.BLUE_BRIGHT, Colors.RED_BRIGHT, Colors.GREEN_BRIGHT, Colors.YELLOW_NORMAL
|
|
]
|
|
}
|
|
|
|
|
|
# This dictionary contains which logo should be used for each supported distribution.
|
|
LOGOS_DICT = {
|
|
Distributions.ALPINE_LINUX: logos.ALPINE_LINUX,
|
|
Distributions.ANDROID: logos.ANDROID,
|
|
Distributions.ARCH_LINUX: logos.ARCH_LINUX,
|
|
Distributions.BUNSENLABS: logos.BUNSENLABS,
|
|
Distributions.CENTOS: logos.CENTOS,
|
|
Distributions.CRUNCHBANG: logos.CRUNCHBANG,
|
|
Distributions.DEBIAN: logos.DEBIAN,
|
|
Distributions.ELEMENTARY: logos.ELEMENTARY,
|
|
Distributions.FEDORA: logos.FEDORA,
|
|
Distributions.FREEBSD: logos.FREEBSD,
|
|
Distributions.GENTOO: logos.GENTOO,
|
|
Distributions.KALI_LINUX: logos.KALI_LINUX,
|
|
Distributions.MANJARO_LINUX: logos.MANJARO,
|
|
Distributions.NIXOS: logos.NIXOS,
|
|
Distributions.LINUX: logos.LINUX,
|
|
Distributions.LINUX_MINT: logos.LINUX_MINT,
|
|
Distributions.POP: logos.POP,
|
|
Distributions.OPENBSD: logos.OPENBSD,
|
|
Distributions.OPENSUSE: logos.OPENSUSE,
|
|
Distributions.RASPBIAN: logos.RASPBIAN,
|
|
Distributions.RED_HAT: logos.RED_HAT,
|
|
Distributions.SLACKWARE: logos.SLACKWARE,
|
|
Distributions.UBUNTU: logos.UBUNTU,
|
|
Distributions.WINDOWS: logos.WINDOWS
|
|
}
|
|
|
|
|
|
# The default needed configuration which will be used by Archey is present below.
|
|
DEFAULT_CONFIG = {
|
|
'allow_overriding': True,
|
|
'parallel_loading': True,
|
|
'suppress_warnings': False,
|
|
'honor_ansi_color': True,
|
|
'default_strings': {
|
|
'no_address': 'No Address',
|
|
'not_detected': 'Not detected',
|
|
'virtual_environment': 'Virtual Environment'
|
|
}
|
|
}
|