How to use the tockloader.tab.TAB 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
# Check if this is a TAB locally, or if we should check for it
		# on a remote hosting server.
		if not urllib.parse.urlparse(tab_name).scheme and not os.path.exists(tab_name):
			logging.info('Could not find TAB named "{}" locally.'.format(tab_name))
			response = helpers.menu(['No', 'Yes'],
				return_type='index',
				prompt='Would you like to check the online TAB repository for that app? ')
			if response == 0:
				# User said no, skip this tab_name.
				continue
			else:
				# User said yes, create that URL and try to load the TAB.
				tab_name = 'https://www.tockos.org/assets/tabs/{}.tab'.format(tab_name)

		try:
			tabs.append(TAB(tab_name, args))
		except Exception as e:
			if args.debug:
				logging.debug('Exception: {}'.format(e))
			logging.error('Error opening and reading "{}"'.format(tab_name))

	return tabs