Skip to main content

Adds locks and timeouts to click entrypoints

Project description

Adds locks and timeouts to Click entrypoints.

Where is only one function click_lock.lock_group with the same interface as You define root group and can use it to declare commands or subgroups:

import click
from click_lock import lock_group

cli = lock_group()

@click.argument('seconds', type=int)
def wait(seconds):
    """Wait for particular amount of seconds"""
    import time


Now you have some additional options:


  --lock fname          Path to lock file
  --timeout seconds     Limit script execution time
  --trace / --no-trace  Log traceback in case of timeout  [default: True]
  --help                Show this message and exit.

  wait  Wait for particular amount of seconds

For example, lock script execution:

python --lock /tmp/example.lck wait 10

Limit script execution:

python --timeout 5 wait 10

Download files

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

Source Distribution

click-lock-0.5.1.tar.gz (2.4 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page