Skip to main content

Single line status updates with minimal update sequences.

Project description

Latest release 20200229: Upd: can now be used as a context manager, clearing the line on exit. Upd.without is now a context manager, returning the older state, and accepting an optional inner state (default ""). Upd is now a singleton factory, obsoleting upd_for. Upd.nl: use "insert line above" mode if supported.

Single line status updates with minimal update sequences.

This is available as an output mode in cs.logutils.

Example:

with Upd() as U:
    for filename in filenames:
        U.out(filename)
        ... process filename ...
        upd.nl('an informational line')

Function cleanupAtExit()

Cleanup function called at programme exit to clear the status line.

Function Upd(stream)

Factory for Upd singletons keyed by the id of their backend.

Function upd_for(stream)

Factory for Upd singletons keyed by the id of their backend.

Release Log

Release 20200229: Upd: can now be used as a context manager, clearing the line on exit. Upd.without is now a context manager, returning the older state, and accepting an optional inner state (default ""). Upd is now a singleton factory, obsoleting upd_for. Upd.nl: use "insert line above" mode if supported.

Release 20181108: Documentation improvements.

Release 20170903: New function upd_for(stream) returning singleton Upds. Drop noStrip keyword argument/mode - always strip trailing whitespace.

Release 20160828: Use "install_requires" instead of "requires" in DISTINFO. Add Upd.flush method. Upd.out: fix longstanding trailing text erasure bug. Upd.nl,out: accept optional positional parameters, use with %-formatting if supplied, just like logging.

Release 20150118: metadata fix

Release 20150116: Initial PyPI release.

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.upd-20200229.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file cs.upd-20200229.tar.gz.

File metadata

  • Download URL: cs.upd-20200229.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for cs.upd-20200229.tar.gz
Algorithm Hash digest
SHA256 8f43eda4b8303eb4a930ffa6c32106dba48f075a9b6130e70cad8b5a2b2193a6
MD5 7c3c7ab4d81b3f466a08d469035a9496
BLAKE2b-256 5b2a23edc089d70ddcdda3ef949c70c0ad1d2957839c975861be386db3d7e078

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