Skip to main content

Crossover utility tool

Project description

CrossOver-Util

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 crossover-util

Usage

crossover-util 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

crossover-util plugin my-plugin hello

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crossover_util-0.1.0.15.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

crossover_util-0.1.0.15-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file crossover_util-0.1.0.15.tar.gz.

File metadata

  • Download URL: crossover_util-0.1.0.15.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.1 Darwin/24.0.0

File hashes

Hashes for crossover_util-0.1.0.15.tar.gz
Algorithm Hash digest
SHA256 a168d635a5670888b0bcdb870e66be8468aff802db35d3349b547adae49dbb5d
MD5 9ca8e59ab143f25e2223d4cf89442a8a
BLAKE2b-256 e3cae6a946e4d666f5bca00f667ddab5c812357182bfeee3d12111ac750e2baf

See more details on using hashes here.

File details

Details for the file crossover_util-0.1.0.15-py3-none-any.whl.

File metadata

File hashes

Hashes for crossover_util-0.1.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 39ffd632d0962101e9c7a03669714556ac82dd3a2084023b48a9bd2bb4820e62
MD5 b27ecc2a444ba5ae0e1aa4860a3ff1e3
BLAKE2b-256 302e699c2a65acbc596c72676563a088c09fb5ab17c71ef9d037cf9e95d6e7db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page