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.13.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

crossover_util-0.1.0.13-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crossover_util-0.1.0.13.tar.gz
  • Upload date:
  • Size: 8.0 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.13.tar.gz
Algorithm Hash digest
SHA256 4e6c535045eff734868dbaa1565d70769ab1cb175b991827c9fc6874e49f92e7
MD5 06f13e4e5ef5c8bd622ad3ae2e136c57
BLAKE2b-256 df6a1357b52d62d0b927aba684d87c36f91aace172e857b6a011132633d364fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crossover_util-0.1.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 3e882521452811f8f12512500d9f49e501c6fc6b879ba472e712d77008fcd7a6
MD5 f01e3b8f49fd8d94e6488513b4dd80af
BLAKE2b-256 32b1003ebf778a3c083e2384cd7c40842e61153e06871b54df6c3f8cfce94159

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