How to use the tockloader.helpers.plural 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 / tockloader.py View on Github external
break

			# Get all the fields from the header
			tbfh = TBFHeader(flash)

			if tbfh.is_valid():
				app = InstalledApp(tbfh, address)
				apps.append(app)

				address += app.get_size()

			else:
				break

		if self.args.debug:
			logging.debug('Found {} app{} on the board.'.format(len(apps), helpers.plural(len(apps))))
			for i,app in enumerate(apps):
				logging.debug('  {}. {}'.format(i+1, app))

		return apps
github tock / tockloader / tockloader / main.py View on Github external
def command_install (args):
	check_and_run_make(args)

	# Load in all TABs
	tabs = collect_tabs(args)

	# Install the apps on the board
	tock_loader = TockLoader(args)
	tock_loader.open()

	# Figure out how we want to do updates
	replace = 'yes'
	if args.no_replace:
		replace = 'no'

	logging.status('Installing app{} on the board...'.format(helpers.plural(len(tabs))))
	tock_loader.install(tabs, replace=replace, erase=args.erase, sticky=args.sticky)
github tock / tockloader / tockloader / main.py View on Github external
def command_update (args):
	check_and_run_make(args)
	tabs = collect_tabs(args)

	tock_loader = TockLoader(args)
	tock_loader.open()

	logging.status('Updating application{} on the board...'.format(helpers.plural(len(tabs))))
	tock_loader.install(tabs, replace='only')