How to use the tockloader.helpers.set_terminal_title function in tockloader

To help you get started, we’ve selected a few tockloader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tock / tockloader / tockloader / main.py View on Github external
def main ():
	'''
	Read in command line arguments and call the correct command function.
	'''

	# Cleanup any title the program may set
	atexit.register(helpers.set_terminal_title, '')

	# Setup logging for displaying background information to the user.
	logging.basicConfig(style='{', format='[{levelname:<7}] {message}', level=logging.DEBUG)
	# Add a custom status level for logging what tockloader is doing.
	logging.addLevelName(25, 'STATUS')
	logging.Logger.status = functools.partialmethod(logging.Logger.log, 25)
	logging.status = functools.partial(logging.log, 25)

	# Create a common parent parser for arguments shared by all subparsers. In
	# practice there are very few of these since tockloader supports a range of
	# operations.
	parent = argparse.ArgumentParser(add_help=False)
	parent.add_argument('--debug',
		action='store_true',
		help='Print additional debugging information')
	parent.add_argument('--version',