semvec/pypi-packages huggingface dataset:
kagtcprlib 0.2.1
TCPR library for King Arthur's Gold

# kagtcprlib &middot; ![AUR](https://img.shields.io/aur/license/yaourt.svg) [![Build Status](https://travis-ci.org/benjamingorman/kagtcprlib.svg?branch=master)](https://travis-ci.org/benjamingorman/kagtcprlib)


A TCPR library for King Arthur's Gold, aiming to provide a simple solution for writing interesting TCPR mods.

* Supports async connections to multiple KAG servers.

The basic design of the library is that the user creates a `Client` instance:

```python
client = Client(nickname="playercount", host="localhost", port=50301, rcon_password="ilovetrenchrun")
```

Then adds some handlers to it:

```python
client.add_handler(PingHandler())
```

Then calls the client's `connect` method:

```python
client.connect()
```

Whenever the client receives a line of text from KAG, all matching handlers will be run. If any handler returns some text, it will be sent back to KAG as an RCON command.

What each handler does is totally up to the user. This could involve creating entries in a database, posting to a web API, or just logging to a file.

## Example

```python
import logging
import kagtcprlib
from kagtcprlib.handlers import BaseHandler

class PingHandler(BaseHandler):
    """Respond to 'ping' from KAG with code to print 'pong' in chat.
    """
    def handle(self, client_nickname, timestamp, content):
        if content == "ping":
            logging.info("Got ping from %s, sending pong.", client_nickname)
            return "getNet().server_SendMsg('pong');"


if __name__ == "__main__":
    logging.basicConfig(level=logging.INFO)
    client = kagtcprlib.Client(nickname="playercount", host="localhost", port=50301,
                               rcon_password="ilovetrenchrun")

    client.add_handler(PingHandler())
    client.connect_forever()
```

For more examples see the `examples/` folder.

## Contributing

You are welcome to contribute to this project.

Please ensure your feature branch is based on the `master` branch and is named like `feature-foo-bar`.

You must run `pylint` over your code and ensure it receives at least a score of 9.

## Docs

<https://benjamingorman.github.io/kagtcprlib/>
QtDesign 0.1.0
Custom widgets and utilities for PySide2
Requires Python: >=3.7

# QtDesign
### Overview
QtDesign Widgets are intended to extend the behavior of PySide2 by providing custom widgets that look and behave similarly to native components while allowing additional flexibility when designing an application.

All widgets are designed to work as seamlessly as possible with Qt Designer's widget promotion feature through the use of the `loadUi` method from the [QtdUiTools](src/QtDesign/QtdUiTools.py) module.

### Motivation behind loadUi
One convenient feature of PyQt and Pyside is the ability to rapidly prototype a layout by directly loading a ui file from QtDesigner. PyQt's implementation of this feature allows a ui file to be loaded directly into an existing QWidget. This method allows developers to mimic how their application would work if they were inheriting a compiled version of the widget.

PySide's implementation of this feature unfortunately returns a new QWidget object which makes it awkward to extend the functionality in a way that would mimic a pure python implementation. QtDesign's `loadUi` function was included to mimic the functionality of PyQt's implementation while also automatically including automatic registration of the custom widgets provided by QtDesign.