Gimmicks and hacks to make some of my other modules more robust and less demanding of others.
Project description
Gimmicks and hacks to make some of my other modules more robust and less demanding of others.
Latest release 20250428: Define Buffer from collections.abc.Buffer, or from typing.ByteString for older Pythons.
Short summary:
open_append: Ghastly hack to open something for append entirely because some Linux systems do not let you open a character device for append. Tries sane'a'and falls back through 'r+' and finally to 'w' only ifpathrefers to a character device.
Module contents:
debug(*a, **kw): Wrapper fordebug()which does a deferred import.error(*a, **kw): Wrapper forerror()which does a deferred import.exception(*a, **kw): Wrapper forexception()which does a deferred import.info(*a, **kw): Wrapper forinfo()which does a deferred import.log(*a, **kw): Wrapper forlog()which does a deferred import.open_append(path): Ghastly hack to open something for append entirely because some Linux systems do not let you open a character device for append. Tries sane'a'and falls back through 'r+' and finally to 'w' only ifpathrefers to a character device.r(obj): simplistic versions of cs.lex r() and s()trace(*a, **kw): Wrapper forinfo()which does a deferred import.warning(*a, **kw): Wrapper forwarning()which does a deferred import.
Release Log
Release 20250428: Define Buffer from collections.abc.Buffer, or from typing.ByteString for older Pythons.
Release 20250323: Provide direct r() and s() instead of circular cs.lex import.
Release 20240316: Fixed release upload artifacts.
Release 20230331: New open_append to handle idiotic Linux do-not-open-tty-for-append semantics.
Release 20230212: Add gimmicks for cs.lex.r and cs.lex.s.
Release 20230210: DEVNULL default open for "r+b" instead of "wb".
Release 20221228: Generalise the logging function map, add trace function, bugfix logging call lookup.
Release 20220429: Add DEVNULL symbol, needed before Python 3.3.
Release 20211208: Define TimeoutError.
Release 20210306: Add simple implementations of nullcontext and SimpleNamespace.
Release 20200418.1: Initial release with logging call stubs.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cs_gimmicks-20250428.tar.gz.
File metadata
- Download URL: cs_gimmicks-20250428.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d772c337bff47c81af52fac5494eb25eeecf13e772cf2d97063ba20c0dd4d63
|
|
| MD5 |
1753e9329e667ee4bc8aeac186a933be
|
|
| BLAKE2b-256 |
8a04b052735c026d01f4e10210456e115c01a1ef4d9a2df5d91c2a5397789af9
|
File details
Details for the file cs_gimmicks-20250428-py2.py3-none-any.whl.
File metadata
- Download URL: cs_gimmicks-20250428-py2.py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84174067a89eeed6c93353e9514a8cecd51f97e9b63d941cc3707a895284d1a0
|
|
| MD5 |
9242c120210ae2d7ab66fe49bf7816e4
|
|
| BLAKE2b-256 |
d0942575ee6ffa0d98533f534de9bed2febbbf5e532b0892446ca357d26af172
|