rsclib: Utility Routines

Author: Ralf Schlatterbeck <rsc@runtux.com>

The library includes various utility modules used in other projects.

Resources

Download the source at https://sourceforge.net/projects/rsclib/ and install using the standard python setup, e.g.:

python setup.py install --prefix=/usr/local

Alternatively get it from pypi and/or install via pip.

Changes

Version 0.67: Bugfixes in rational and iter_recipes.batched

Version 0.66: Hexdump parsing, iter_recipes.batched

Version 0.65: Use pyproject.toml

Version 0.64: Small execute.Log updates

Version 0.63: Python3 fixes

Version 0.62: Python3 fixes

Version 0.61: sqlparser

Version 0.60: Python3 fixes

Version 0.59: sqlparser

Version 0.58: sqlparser

Version 0.57: isdn

Version 0.56: ast_call, isdn

Version 0.55: LOCKDIR

Version 0.54: inductance, sqlparser

Version 0.53: inductance, IPv4 address

Version 0.52: Small fixes

Version 0.51: Small fixes

Version 0.50: Small additions

Version 0.49: Python3 compatibility

Version 0.48: Fixes for execute

Version 0.47: Fixes for IP_Address; pypi

Version 0.46: Additions to ast_probe; Bug-fix

Version 0.45: Fix ISDN ports

String reprentation had leading unicode 'u'

Version 0.44: Make line-waiting for bero configurable

For cluster resource berofos we make waiting for the L1 and L2 of the ISDN line configurable. The hard-coded default was too low.

Version 0.43: Support new berofos firmware

The new berofos (failover switch) firmware has some new low-level commands which we now accept when getting the device status.

Version 0.42: Feature enhancements

Add crm for pacemaker cluster management, new ast_probe for checking of asterisk status. Fixes to ocf and ast_call.

Version 0.41: Minor feature enhancements

Fixes to Freshmeat, pycompat, sql-dump parser.

Version 0.40: Distribution bug-fix

Renaming of README lead to the missing file README.rst in the distro.

Version 0.39: Minor feature enhancements

Fixes to hexdump, unicode issues (elementtree wrapper, stateparser). Add some fixes to IP_Address comparison. The nmap output has changed in recent versions, adapt to new format.

Version 0.38: Minor feature enhancements

Fix boolean conversion of IP6_Address (and IP4_Address).

Version 0.37: Minor feature enhancements

Change sort-order of IP_Address, make IP_Address immutable, use metaclass magic to allow copy-constructor semantics.

Version 0.36: Minor feature enhancements

Allow auto-coercion of comparison parameters. Add parent property and is_sibling test.

Version 0.35: Minor feature enhancements

Add 'mask_len' as an alias of 'mask' to IP_Address.

Version 0.34: Minor feature enhancements

Fix trafficshape to use new tc syntax. Add label to hexdump.

Version 0.33: Minor feature enhancements

More fixes for ast_call.

Version 0.32: Minor feature enhancements

More fixes for ast_call.

Version 0.31: Minor feature enhancements

Fix ast_call for immediately failing calls. Fix dahdi channel computation in isdn.py.

Version 0.30: Minor feature enhancements

Fix how dahdi vs. mISDN interpret what is called an interface and what is called a port. In mISDN we can combine several ports (physical lines) to an interface. In dahdi both are the same (a port is a span in dahdi).

Version 0.29: Minor feature enhancements

The lcr module is now named isdn. It can now handle isdn interfaces managed by Asterisk DAHDI in addition to Linux Call Router (LCR).

Version 0.28: Minor feature enhancements

Fix inductance formula of Robert Weaver, thanks Robert for pointing me to the correction you did on your new site! For most doctests in the inductance module the error was in the lower percentage points. Add an xxrange iterator to the iter_recipes that can replace pythons native xrange iterator but works with long integers. Needed for some operations on IPv6 addresses in the IP_Address module.

Version 0.27: Minor feature enhancements

Add pageurl and pageinfo attributes to HTML_Parser.Page_Tree, other enhancements to HTML_Parser. Add pickle support to parser classes. Fix comparison of IP_Address classes.

Version 0.26: Minor feature enhancements

Fix double-utf-8-encoding option for sqlparser. Enhance stderr handling for exec_pipe.

Version 0.25: Minor feature enhancements

Add sqlparser for parsing SQL dumps of PostgreSQL and mysql, add Phone to parse phone numbers.

Version 0.24: Minor feature enhancements

Better syntax checks and comparison operators for IP_Address, bug fixes for parser and __str__ for IP_Address.IP6_Address

Version 0.23: Minor feature enhancements

IP4_Address can now be put in a dict, add a subnets iterator for IP4_Address. Factor IP_Address and add IP6_Address

Version 0.22: Minor feature enhancements

Allow unicode ip address input, hopefully make rsclib installable via pip.

Version 0.21: Minor feature enhancements

Fix autosuper: allow to inherit from non-autosuper classes, some small fixes to ast_call and lcr parser. Fix ETree pretty-printing. Update Freshmeat to new hostname. Add dotted netmaks parsing to IP4_Address.

Version 0.20: Not announced on freshmeat

Database value output for ast_cdr, added inductance calculation.

Version 0.19: Not announced on freshmeat

Extend ETree with a walk method and implement small ldap library

Version 0.18: Not announced on freshmeat

Bugfix of ast_call and update for asterisk 1.6, small extension to IP4_Address.

Version 0.17: Not announced on freshmeat

Factor ETree (extended ElementTree) from HTML_Parse. New Freshmeat module to get project information and submit new releases via the new freshmeat REST API. New simple hexdump module.

Version 0.16: Not announced on freshmeat

Add an iptables to tc translator for translating mangle rules in the iptables PREROUTING chain to appropriate tc commands (using an ipt action and mirred redirect actions).

Version 0.15: Not announced on freshmeat

Add a framework for traffic shaping with linux iproute (tc). Minor updates to iter_recipes.

Version 0.14: Not announced on freshmeat

Add a framework for process pipeline execution, processes can either be python methods or external programs (with parameter list). They can be connected in a pipe and there may be T-points in the pipe, where the pipe forks into two or more pipelines fed by the output of one process.

Version 0.13: Not announced on freshmeat

Bug-Fix Release: Fix signal handler in timeout.py

Version 0.12: Not announced on freshmeat

Add a simple timeout mechanism using SIGALRM.

Version 0.11: Not announced on freshmeat

Add a parser for CDR records in asterisk. We currently use text-files only, this might be later extended for database use. Some fixes for ast_call, make call-handling more robust (some race conditions would identify events of other calls as belonging to our initiated call). Add an execute module for executing commands and handling IO, this also has a Lock and a Log mixin. Add ocf.py, a small framework for writing OCF scripts for the heartbeat cluster resource manager (probably also usable for the newer version called pacemaker but for now only tested with the version in Debian stable aka lenny). Add lcr.py to model the status of Linux Call Router ISDN lines.

Version 0.10: Not announced on freshmeat

add ast_call for asterisk auto-dialling, small fixes to IP4_Address, add bero*fos configurator, experimental code for checking PDF signature

Version 0.9: Not announced on freshmeat

Add binom to the Math package, add Firstname, Bug-Fix Release Rational

Version 0.8: Not announced on freshmeat

Added more documentation. State-machine parser stateparser implemented. Rational number arithmetic package added.

Version 0.7: Not announced on freshmeat

Small Python library with various things such as Configuration file parsing (in Python syntax), HTML and PDF parsing.