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

Uploaded Source

Built Distribution

crossover_util-0.1.0.6-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crossover_util-0.1.0.6.tar.gz
  • Upload date:
  • Size: 7.9 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.6.tar.gz
Algorithm Hash digest
SHA256 3581d999d71fa0bc5cbda30f3125c4cf35803914a92a2a8b2ae27fb43d19ed3c
MD5 2e0f444918e22cbb61578fbeac9e2638
BLAKE2b-256 7b818d21863c65c1fb9544c1ed0f19b1eef3b826bc519aefc39166d058f17067

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crossover_util-0.1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3b74e461c508cede1ea81dfb6aceff9c22e03fe2681255d4c0a1eaeab1d6acb1
MD5 5b84617734c4cb505f85c69b7b88177c
BLAKE2b-256 6f9378e5b2b3aff42d419710d66a7eaa9df572c021da7e65a46dab1be387e5c1

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