license_updater package

Subpackages

Submodules

license_updater.defaults module

license_updater.logger module

class license_updater.logger.ColorizingStreamHandler(nocolor=False, stream=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, use_threads=False)[source]

Bases: StreamHandler

BLACK = 0
BLUE = 4
BOLD_SEQ = '\x1b[1m'
COLOR_SEQ = '\x1b[%dm'
CYAN = 6
GREEN = 2
MAGENTA = 5
RED = 1
RESET_SEQ = '\x1b[0m'
WHITE = 7
YELLOW = 3
can_color_tty()[source]
colors = {'CRITICAL': 1, 'DEBUG': 4, 'ERROR': 1, 'INFO': 2, 'WARNING': 3}
decorate(record)[source]
emit(record)[source]

Emit a record.

If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an ‘encoding’ attribute, it is used to determine how to do the output to the stream.

property is_tty
class license_updater.logger.LogColors[source]

Bases: object

BOLD = '\x1b[1m'
ENDC = '\x1b[0m'
OKBLUE = '\x1b[94m'
OKCYAN = '\x1b[96m'
OKGREEN = '\x1b[92m'
PURPLE = '\x1b[95m'
RED = '\x1b[91m'
UNDERLINE = '\x1b[4m'
WARNING = '\x1b[93m'
class license_updater.logger.Logger[source]

Bases: object

cleanup()[source]
debug(msg)[source]
error(msg)[source]
exit(msg, return_code=1)[source]
handler(msg)[source]
info(msg)[source]
location(msg)[source]
progress(done=None, total=None)[source]
set_level(level)[source]
set_stream_handler(stream_handler)[source]
shellcmd(msg)[source]
text_handler(msg)[source]

The default log handler prints the output to the console.

warning(msg)[source]
yellow(msg)[source]
class license_updater.logger.Table(items)[source]

Bases: object

Format a list of dicts into a table

available_width(columns)[source]

Calculate available width based on fields we cannot truncate (urls)

property color

Return a random color

ensure_complete()[source]

If any data missing fields, ensure they are included

show(limit=25, title=None)[source]

Pretty print a table of content

table_columns()[source]

Shared function to return consistent table columns

table_rows(columns, limit=25)[source]

Shared function to yield rows as a list

license_updater.logger.add_prefix(msg, char='>>')[source]

Add an “OKBLUE” prefix to a message

license_updater.logger.setup_logger(quiet=False, printshellcmds=False, nocolor=False, stdout=False, debug=False, use_threads=False, wms_monitor=None)[source]
license_updater.logger.underline(msg)[source]

Return an underlined message

license_updater.version module

Module contents