Skip to main content

Persistent filesystem based flags for state and control.

Project description

Filesystem visible boolean flags for control and status, allowing easy monitoring of services or other status, and control by flag management for programmes which also monitor the flags.

The flags are expressed as individual files with uppercase names in a common directory ($HOME/var/flags by default); an empty or missing file is “false” and a nonempty file is “true”.

The Flags class provides easy Pythonic access. If presents as a modifiable mapping whose keys are the flag names.

The is also a FlaggedMixin class providing convenient methods and attributes for maintaining a collection of flags associated with some object with flag names prefixed by the object’s .name attribute uppercased and with an underscore appended:

class SvcD(...,FlaggedMixin):
  def __init__(self, name, ...)
    self.name = name
    FlaggedMixin.__init__(self)
    ...
  def disable(self):
    self.flag_disabled = True
  def restart(self):
    self.flag_restart = True
  def _restart(self):
    self.flag_restart = False
    ... restart the SvcD ...

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

cs.app.flag-20170906.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file cs.app.flag-20170906.tar.gz.

File metadata

File hashes

Hashes for cs.app.flag-20170906.tar.gz
Algorithm Hash digest
SHA256 ba881980012a927a96f0970a6bbf99f73961a8e96c8ffe21b430f50ae9280bf2
MD5 2c2070c45982d6a377df548e520d3226
BLAKE2b-256 9eb74f34e1c5dd54a075d4d0272cea0a6877f2db8ee551a24e205865e477e007

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