Outputs exceptions in popups
Project description
MetaErrors lib (v2.0)
This library redirects errors to popups (supported for Windows, Linux, macOS and FreeBSD.)
(Go to changelog)
Table of contents
- Installing
- Constants and vars
- Recommended structure
- Functions and syntax
- Supporting
- Build
- Script configurations
- Workflows
Installing
python -m pip install metaerrors
Constants and vars
Constants indicate the popup type, and std_title and msg_format indicate the standard title and message format. Example of the message format:
msg_format = "{name}: {msg}"
Standard values:
msg_format = "{name}: {msg}"
std_title = "The program terminated with the error:" # For metaraise
Recommended structure
To redirect your program's errors to metaraise,
I recommend the following structure:
from metaerrors import metaraise
try:
#Your program
except Exception as e:
metaraise(e)
Functions and syntax
show()
def show(msg: str, title: str, mode: int):
"""Displays a pop-up"""
msg - your message
title - title of popup
mode - display mode (INFO, WARN, ERROR, STD)
metaraise()
def metaraise(err: BaseException, title: str = std_title, frmt: str = msg_format, do_exit: bool = False):
"""Raise Replacement"""
err - a BaseException type object
title - title
frmt - msg_format
do_exit - Determines whether an exit with code 1 will be performed
OS modules (win, mac, linux) have the same functions.
Supporting
This library is supported for Windows, Linux, and macOS.
Some functions are not supported by some OS
All functions are supported in Windows
The zenity package does not support the header in Linux, and the notify-send package does not support the pop-up type
macOS does not support the pop-up type (INFO, WARN, ERROR, STD).
On FreeBSD, modes only work with the zenity package installed.
Build
To build the wheel, run:
python -m pip install setuptools wheel
python setup.py bdist_wheel
Don't forget to change the config in the setup.py file before doing this.
All wheels are stored in the dist folder
Script configurations
If your editor supports run configurations (for example, PyCharm), then you will be able to run various scripts:
- Clear wheels
- Del lib
- Install
- Build wheel
- Setup
- Clean + Build Wheel
Workflows
This project contains one workflow that:
- collects the wheel library,
- adds it to the release files,
- and uploads the release to PyPi.
If you encounter any errors, please open issue on GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metaerrors-2.0-py3-none-any.whl.
File metadata
- Download URL: metaerrors-2.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b0edfa3248bcae6d5b51da554abf8045c52e7a76085df5d7ef77fc23a53750d
|
|
| MD5 |
df577979cda9460aa0ef4e8044623e41
|
|
| BLAKE2b-256 |
f5e7262318c1fbc935d8552725f534e7685f067f9ca954706cbf070cbe726834
|
Provenance
The following attestation bundles were made for metaerrors-2.0-py3-none-any.whl:
Publisher:
release_build.yml on IgorNk500/metaerrors
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
metaerrors-2.0-py3-none-any.whl -
Subject digest:
8b0edfa3248bcae6d5b51da554abf8045c52e7a76085df5d7ef77fc23a53750d - Sigstore transparency entry: 780328265
- Sigstore integration time:
-
Permalink:
IgorNk500/metaerrors@cde15ff23fb154e6b434b9ab332e5b4f84551839 -
Branch / Tag:
refs/tags/release-2.0 - Owner: https://github.com/IgorNk500
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_build.yml@cde15ff23fb154e6b434b9ab332e5b4f84551839 -
Trigger Event:
release
-
Statement type: