Metadata-Version: 2.4
Name: metaerrors
Version: 2.0
Summary: Outputs exceptions in popups
Home-page: https://github.com/IgorNk500/metaerrors
Author: IgorNk500
License: MIT
Keywords: exceptions,errors,popup,pop-up,error,exception,popups,pop-ups,dialog,window,dialog window,dialog windows
Platform: Linux
Platform: Windows
Platform: macOS
Platform: FreeBSD
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 5 - Production/Stable
Classifier: Natural Language :: English
Classifier: Operating System :: Microsoft :: Windows :: Windows 11
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Classifier: Operating System :: Microsoft :: Windows :: Windows 8.1
Classifier: Operating System :: Microsoft :: Windows :: Windows 8
Classifier: Operating System :: Microsoft :: Windows :: Windows 7
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: BSD :: FreeBSD
Classifier: Operating System :: POSIX :: Linux
Classifier: Environment :: GPU
Requires-Python: >=3.8.0
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: platform
Dynamic: requires-python
Dynamic: summary

# MetaErrors lib (v2.0)
### This library redirects errors to popups (supported for Windows, Linux, macOS and FreeBSD.)
###### *(Go to [changelog](https://github.com/IgorNk500/metaerrors/blob/master/changelog.md))*


## Table of contents
1. [Installing](#installing)
2. [Constants and vars](#constants-and-vars)
3. [Recommended structure](#recommended-structure)
4. [Functions and syntax](#functions-and-syntax)
5. [Supporting](#supporting)
6. [Build](#build)
7. [Script configurations](#script-configurations)
8. [Workflows](#workflows)

## Installing
```bash
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: 
```python
msg_format = "{name}: {msg}"
```
### Standard values:
```python
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:
```python
from metaerrors import metaraise

try:
    #Your program
except Exception as e:
    metaraise(e)
```

## Functions and syntax
### show()
```python
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()
```python
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](#constants-and-vars)\
`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:**
```bash
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](https://github.com/IgorNk500/metaerrors/issues/new "New issue") on GitHub.
