(dest_path, delegate=None)
Main function that attempts to load or update PyV8 binary.
	First, it loads list of available PyV8 modules and check if
	PyV8 should be downloaded or updated.
	@param dest_path: Path where PyV8 lib should be downloaded 
	@param delegate: instance of LoaderDelegate that will receive
	loader progress events
	@returns: `True` if download progress was initiated
Main function that attempts to load or update PyV8 binary.
	First, it loads list of available PyV8 modules and check if
	PyV8 should be downloaded or updated.
Main function that attempts to load or update PyV8 binary . First it loads list of available PyV8 modules and check if PyV8 should be downloaded or updated .
def load(dest_path, delegate=None):
	"""
	Main function that attempts to load or update PyV8 binary.
	First, it loads list of available PyV8 modules and check if
	PyV8 should be downloaded or updated.
	@param dest_path: Path where PyV8 lib should be downloaded 
	@param delegate: instance of LoaderDelegate that will receive
	loader progress events
	@returns: `True` if download progress was initiated
	"""
	if delegate is None:
		delegate = LoaderDelegate()

	config = get_loader_config(dest_path)

	if 'PyV8' in sys.modules and (config['skip_update'] or time.time() < config['last_update'] + CHECK_INTERVAL):
		# No need to load anything: user already has PyV8 binary
		# or decided to disable update process
		delegate.log('No need to update PyV8')
		return False

	def on_complete(result, *args, **kwargs):
		if result is not None:
			# Most recent version was downloaded
			config['last_id'] = result				
			if 'PyV8' not in sys.modules:
				# PyV8 is not loaded yet, we can safely unpack it 
				unpack_pyv8(dest_path)

		config['last_update'] = time.time()
		save_loader_config(dest_path, config)
		delegate.on_complete(*args, **kwargs)

	# try to download most recent version of PyV8
	# As PyV8 for Sublime Text spreads the world, it's possible
	# that multiple distinct PyV8Loader's may start doing the same
	# job at the same time. In this case, we should check if there's
	# already a thread that load PyV8 and hook on existing thread
	# rather that creating a new one
	thread = None
	thread_exists = False
	for t in threading.enumerate():
		if hasattr(t, 'is_pyv8_thread'):
			print('PyV8: Reusing thread')
			thread = t
			thread_exists = True
			break

	if not thread:
		print('PyV8: Creating new thread')
		thread = PyV8Loader(get_arch(), dest_path, config, delegate=delegate)
		thread.start()

	delegate.on_start()
	
	# watch on download progress
	prog = ThreadProgress(thread, delegate, thread_exists)
	prog.on('complete', on_complete if not thread_exists else delegate.on_complete)
	prog.on('error', delegate.on_error)
def load ( dest_path , delegate = None ) : if delegate is None : delegate = LoaderDelegate ( ) config = get_loader_config ( dest_path ) if 'PyV8' in sys . modules and ( config [ 'skip_update' ] or time . time ( ) < config [ 'last_update' ] + CHECK_INTERVAL ) : # No need to load anything: user already has PyV8 binary # or decided to disable update process delegate . log ( 'No need to update PyV8' ) return False def on_complete ( result , * args , * * kwargs ) : if result is not None : # Most recent version was downloaded config [ 'last_id' ] = result if 'PyV8' not in sys . modules : # PyV8 is not loaded yet, we can safely unpack it  unpack_pyv8 ( dest_path ) config [ 'last_update' ] = time . time ( ) save_loader_config ( dest_path , config ) delegate . on_complete ( * args , * * kwargs ) # try to download most recent version of PyV8 # As PyV8 for Sublime Text spreads the world, it's possible # that multiple distinct PyV8Loader's may start doing the same # job at the same time. In this case, we should check if there's # already a thread that load PyV8 and hook on existing thread # rather that creating a new one thread = None thread_exists = False for t in threading . enumerate ( ) : if hasattr ( t , 'is_pyv8_thread' ) : print ( 'PyV8: Reusing thread' ) thread = t thread_exists = True break if not thread : print ( 'PyV8: Creating new thread' ) thread = PyV8Loader ( get_arch ( ) , dest_path , config , delegate = delegate ) thread . start ( ) delegate . on_start ( ) # watch on download progress prog = ThreadProgress ( thread , delegate , thread_exists ) prog . on ( 'complete' , on_complete if not thread_exists else delegate . on_complete ) prog . on ( 'error' , delegate . on_error )