1
0
mirror of https://github.com/HorlogeSkynet/archey4 synced 2025-04-08 16:00:17 +02:00

180 Commits

Author SHA1 Message Date
Michael Bromilow
b7c9f8733a
Type changes for back-compat to 3.6, linting pass 2024-04-13 21:22:03 +01:00
Michael Bromilow
d17dfc7d29
Tests cleanup 2024-04-13 21:00:40 +01:00
Michael Bromilow
641dcd21ad
Entries: Use __iter__ and __next__ magic methods.
Incl. changed tests where appropriate.
2024-04-08 22:23:10 +01:00
Michael Bromilow
02ea37fbbf
[Output/Entry] Changes entries output method to pretty_value property.
This is a "bit more OOP" and easier to understand.

+ Unrelated change: Fix stupid range test I added to `Colors` -- has been bugging me since I noticed it :)
2024-04-08 22:18:50 +01:00
Michael Bromilow
d5fc44d2d9 [GPU] Parses lspci to avoid classing 3D NAND devices as GPUs.
Closes #149.
2024-04-04 10:47:57 +00:00
8817077a5e [TEST] Fixes logos consistency test case ignoring alternative styles 2024-02-17 17:39:52 +01:00
d3a08e6ff0 [WINDOW_MANAGER] Adds display server protocol to entry
Co-Authored-By: Tobilike <80016610+Tobilike@users.noreply.github.com>
2024-01-12 18:55:31 +00:00
Michael Bromilow
56e36c0498
[TESTS] Fixes Terminal entry test (#143)
This patch is a fix-up for 44a357efa15a8d7f9818ec575c2caff3d89670af.
2024-01-07 08:49:53 +00:00
Samuel FORESTIER
12a0bcf34d [LAN_IP] Allows link-local IP addresses hiding
> closes #137
2023-08-24 06:18:40 +00:00
Michael Bromilow
44a357efa1 [Colors] Add Colors8Bit class for 256-color text
Splits `Colors` into a base class `Style` and a subclass `Colors`.
Adds a new subclass `Colors8Bit`, which adds support for 256 colours
(8-bit) mode.
2023-06-25 12:38:59 +00:00
Michael Bromilow
c6229484fc
[WAN_IP] Fall back to HTTP properly on DNS connection errors (#134) 2023-06-18 07:02:09 +00:00
Samuel FORESTIER
c0256765e0
[UPTIME] Logs uptime errors at warning level (#133) 2023-06-18 06:49:03 +00:00
Samuel FORESTIER
415a320949 [STYLE] Fixes Black formatting 2023-03-18 18:00:12 +01:00
Samuel FORESTIER
12343f206f [CPU] Fixes detection on aarch64 platforms, lacking ACPI PPTT
This patch brings proper support for Raspberry Pi 4.

It requires util-linux v2.37+ (see <73c0a766ff>).

> closes #127
2023-01-20 17:29:07 +01:00
Samuel FORESTIER
f43ea3cefd [STYLE] Fixes Black formating (follow-up for e1169a4) 2022-11-15 20:33:21 +01:00
Michael Bromilow
e1169a48aa [Output] Adds configuration option for preferred logo style 2022-11-15 19:00:57 +00:00
Samuel FORESTIER
aac07a5567 [STYLE] Restores support for Python 3.6 and fixes isort 2022-11-14 21:02:53 +01:00
Samuel FORESTIER
0b931ba07d [STYLE] Fixes compliance with new Mypy default (no_implicit_optional) 2022-11-14 20:58:27 +01:00
Samuel FORESTIER
3b261e93f9 [TEST] Fixes a remaining trace of vX.Y.Z version format 2022-09-22 16:51:47 +02:00
Samuel FORESTIER
43e7521a60 [META] Bumps Archey to v4.14.0.0 2022-09-22 16:47:04 +02:00
Samuel FORESTIER
27e33f144a [BREAKING][CORE] Don't report WSL as a "Windows" distribution
This patch is also a fix for environments lacking of systemd support (as
virt-what actually does not detect "wsl" fact).

Archey will now honor the logo of the Linux distribution WSL-emulated.

> closes #118
2022-09-18 11:42:31 +02:00
Samuel FORESTIER
f613fef4c9 [STYLE] Formats the code using Black and isort 2022-09-18 11:09:21 +02:00
Samuel FORESTIER
01d1d90bf8 [ENTRY][Model] Stops relying on dmidecode for virt. env. probing
On Linux, we don't actually need `dmidecode` to gather hardware info.
This commit follows da5780e2 and simplify furthermore the `Model` entry
initialization.

Although it's only a first step, as `virt-what` uses `dmidecode` under
the hood.

In some virtual environments, `Model` might now show additional info.

> See <https://0pointer.net/blog/projects/no-more-dmidecode.html>
2022-09-17 16:46:48 +02:00
Michael Bromilow
1c51b2a163 [ENTRY][Disk] Fixes overcounting of APFS volumes on macOS
Replaces each APFS volume entry by an aggregation of their respective
containers.

> closes #115
2022-09-12 17:00:43 +00:00
Michael Bromilow
600bfd8a94 [ENTRY][LoadAverage] Restricts decimal places with configuration option 2022-09-12 16:36:53 +00:00
Michael Bromilow
7a305988df [ENTRY][Model] Prevents vendor duplication when product name contains it 2022-09-12 16:36:53 +00:00
sbz
766ff46c9a
[CPU|RAM|MODEL] Adds support for FreeBSD (#114)
Co-authored-by: Samuel FORESTIER <HorlogeSkynet@users.noreply.github.com>
2022-09-03 07:37:45 +00:00
Samuel FORESTIER
a0ee385f9a [ENTRY] Adds a new "Load Average" entry (for UNIX platforms) 2022-05-26 17:39:57 +02:00
Samuel FORESTIER
76f11018c3 [CORE] Adds some missing method static types 2022-05-26 11:41:20 +02:00
Samuel FORESTIER
2cd1dcd41c [CUSTOM][SECURITY] Adds "LPE" attacks mitigation
As new "custom" entries brings arbitrary command execution capabilities
in Archey code-base, we enforce some basic security checks to assert
loaded configuration files are not too "permissive".
The idea is to keep "W ^ X" enforced, so if another user _could_ write
to one of the configuration files, defined custom entries won't be
loaded.

Archey will consider a configuration file not too "permissive" if it
belongs to the running user (or the system administrator) **AND** if
group nor other users can write to it.
2022-05-15 14:38:54 +02:00
Samuel FORESTIER
0dc2b39724 [CORE] Adds support for custom entries
This patch brings a first support for "custom entries" to Archey. It
mainly allows users to run custom commands through their configuration
file.

In order to give "power to the user" for most of situations:
* STDERR output **MAY** be silenced through `log_stderr` option
* command exit status code **MAY** be ignored through `check` option

Multi-lines results will be joined on the same line, unless `one_line`
option is disabled.

Users **SHOULD** only enable `shell` option if they have to.

> See #111 for rationale.
2022-05-08 16:00:05 +02:00
Samuel FORESTIER
026a4fd0f2
[OUTPUT] Allows entries color overriding from configuration (#110) 2022-03-17 18:20:39 +00:00
Samuel FORESTIER
c3f0518e43 [TEMPERATURE] Adds sensors_excluded_subfeatures config. option
> closes #107
2022-01-15 14:15:53 +01:00
Samuel FORESTIER
aa664a3999 [DISTRO] Removes square brackets around architecture from entry output 2021-11-13 12:01:27 +01:00
Samuel FORESTIER
36d9832ef2 [MODEL] Adds product vendor name and implement fallback to board info 2021-11-13 11:45:11 +01:00
Samuel FORESTIER
f90b1b5490 [SHELL] Allows os.getuid to be missing when querying NSS 2021-11-13 11:00:04 +01:00
Samuel FORESTIER
8de211a39d [MODEL] Prefers EAFP for virt-what/dmidecode calls
This patch drops `os.getuid` usage in `Model`, for virtual environment
  detection.
This way, additional information may be gathered if, for some reasons,
  `virt-what` and/or `dmidecode` can be executed by the process owner.
It also drastically simplifies unit testing.
2021-11-13 10:43:05 +01:00
Samuel FORESTIER
e96758ca71 [PACKAGES] Adds support for pkgin (NetBSD) package manager 2021-11-13 09:47:06 +01:00
Lou Rinaldi
0e219518db
[DISK] Fixes df output parsing when FS column contains whitespaces (#102)
* [STYLE] Silences new Pylint recommendation C0209
* [CI] Forces macOS-10.15 as pypy 3.6 is unavailable afterwards (see actions/virtual-environments#4060)

Co-authored-by: Samuel FORESTIER <dev@samuel.domains>
2021-10-16 07:24:13 +00:00
Samuel FORESTIER
d76512a014 [PACKAGES] Only run pkg on *BSD systems
> See <dylanaraps/neofetch#1834>
2021-09-04 11:32:23 +02:00
Samuel FORESTIER
f075381e79 [ENTRY] Prevents disabled special field from being set as options 2021-09-04 10:49:03 +02:00
Samuel FORESTIER
58af4a7769 [OUTPUT][TEST] Follow-up for db22230 (fixes corresponding case) 2021-09-04 10:18:10 +02:00
Samuel FORESTIER
dc2c7cbf4a [TESTS][TEMPERATURE] Adds a case for multiple chipsets (see 063b19d) 2021-08-29 09:44:29 +02:00
Samuel FORESTIER
7f8dd2035e [CORE] Provisions a dedicated logging.Logger object to each entry
+ also makes logging lines display the origin entry name

> Developers using Python API can now easily silence entries warning messages:

    logging.getLogger('archey.entries.temperature').setLevel(logging.ERROR)
2021-08-28 21:16:23 +02:00
Samuel FORESTIER
cba31884bd [STYLES] Adds some optional Pylint checkers from the extensions module 2021-08-28 18:30:26 +02:00
Samuel FORESTIER
87c17a2c87 [CORE] Explicits encoding parameter for open calls (Pylint warning) 2021-08-28 18:29:01 +02:00
Samuel FORESTIER
9d337e8628 [CHORE][LOGOS] Sets right-padding in Output instead of logos modules 2021-07-11 15:30:15 +02:00
Samuel FORESTIER
db274ad743 [CHORE] Replaces spurious 0xA0 occurrences by proper white-spaces 2021-07-11 15:30:13 +02:00
Samuel FORESTIER
3f1c4fbce8 [LAN_IP|WAN_IP] Allows deactivation of single-line output (one_line) 2021-05-08 11:38:00 +02:00
Samuel FORESTIER
1369a69ed0 [CORE][BREAKING] Implements "pretty naming" for multiple-words entries
> Based on @GentleHoneyLover's comment (<https://github.com/HorlogeSkynet/archey4/issues/98#issuecomment-827838361>) :
>   * `DesktopEnvironment` -> `Desktop Environment`
>   * `WindowManager` -> `Window Manager`
>   * `LAN_IP` -> `LAN IP`
>   * `WAN_IP` -> `WAN IP`

Unless your configuration file specifies `name` option for entries, this will change text and JSON output entries names/keys.
2021-05-08 11:31:18 +02:00