Skip to main content

A set of classes and functions for managing pidfile.

Project description

uc_pidfile

A set of classes and functions for managing pidfile.

It is part of the Unicon project.

https://unicon.10k.me

Using:

import uc_pidfile

Functions:

process_exists(pid)

Checks if the process is running. Returns True if process exists and False if not.

read_pid(filename)

Reads pid from file.

If the file exists and is successfully read, then returns pid otherwise returns None.

May raise exceptions:

  • PermissionError
  • ValueError

validate_pidfile(filename)

Checks the contents of pidfiles for an integer.

Returns True if valid or False if not.

May raise exceptions:

  • FileNotFoundError
  • PermissionError

is_running(filename)

Returns True if the process is running, otherwise returns False.

It will also be considered that the process is started even if there is no access to the file. And it will be considered that the process is not started if there is no file or the file contains incorrect data.

Classes:

PidFile(filename, overwrite=False)

Creates pid file.

If the file already exists and overwrite = True it will be overwritten. But if overwrite = false then this will throw an exception FileExistsError.

May raise exceptions:

  • FileExistsError
  • PermissionError
  • FileNotFoundError (If the target directory does not exist, for example.)

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

uc_pidfile-0.0.3.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uc_pidfile-0.0.3-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file uc_pidfile-0.0.3.tar.gz.

File metadata

  • Download URL: uc_pidfile-0.0.3.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for uc_pidfile-0.0.3.tar.gz
Algorithm Hash digest
SHA256 83b06a8820055df652c52e9178e48b3e185529898b7453829392c10e1b4aaaf0
MD5 135575b59411b67aa7e9bc15b2d2fd0d
BLAKE2b-256 3bd8b069d225f54353ed240a4063ff3d35c50089c66a4ef0db6487e734b6d4ff

See more details on using hashes here.

File details

Details for the file uc_pidfile-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: uc_pidfile-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for uc_pidfile-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 73c42a71daaab62c686704b0b69d88f13ba722f079a7c42a9c4395ccfbd863a4
MD5 070492a82633a2dffb6945be7f24a8e9
BLAKE2b-256 0e2a69640e70bc326e2e8d31938d17b6df820f817c0c10022c92b88dd2cb9485

See more details on using hashes here.

Supported by

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