RUTIFU - Random Utilities That I Find Useful
This is a set of Python routines that perform various functions that I find useful for multiple projects.
Log a message to syslog or stdout
Log the traceback for an exception
Log a debug message conditioned on a specified global variable
Thread object that logs a stack trace if there is an uncaught exception
class LogThread(threading.Thread)
Convenience function to create and start a thread
startThread(name, target, **kwargs)
Block a thread indefinitely
Wait until the network is available
Manipulation of strings and lists
Transform a string of words into a camel case name
Create a string of words from a camel case name
Get the value of a json item from a file
Turn an item into a list if it is not already
Truncate or pad a list into a fixed number of items
fixedList(items, nItems, pad=None)
Format an E.164 phone number for display
Format a phone number as E.164
e164number(number, defaultAreaCode="", defaultCountryCode="1")