Crossover utility tool
Project description
CX-tool
This is a collection of utility functions that I have written over the years. I have decided to put them all in one place so that I can easily access them. I have also included a few utility functions that I have found useful from other sources.
Installation
pip install --user cx-tool
Usage
cx-tool install
Write your own plugin
You can add your own plugin that performs a specific task. To do this, you need to create a new Python file in the plugins
directory. The file should contain a class that inherits from the Plugin
class.
To add click command use the
import click
from crossover_util.plugin.plugin import Plugin, clickable
from crossover_util.plugin.context import PluginContext
class MyPlugin(Plugin):
name = "my-plugin"
@clickable
def hello(self):
click.echo("Hello, World!")
def on_load(self):
"""This method is called when the plugin is loaded.
Here you can add any initialization code that you need.
"""
self.cli_command("hello")(self.hello)
def on_start(self, ctx: PluginContext):
"""This method is called when the CrossOver app is started.
Here you can add env variables and arguments to CrossOver app.
"""
ctx.environment["HELLO"] = "WORLD"
To access hello
click subcommand command use the following command
cx-tool my-plugin hello
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 Distribution
cx_tool-0.1.0.32.tar.gz
(14.9 kB
view hashes)
Built Distribution
cx_tool-0.1.0.32-py3-none-any.whl
(19.9 kB
view hashes)
Close
Hashes for cx_tool-0.1.0.32-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1da7adb6097f9c70aaf1dd668f86a3f4a0a1cd36cdba76d6b53ed9090ffad15a |
|
MD5 | 06d03ee5d30d38f0d0e360c54be4c32d |
|
BLAKE2b-256 | aec133fc8b7ec95a99df6d8f33be7d460355fd6321b66625d37b9ab0811537de |