Esempio n. 1
0
File: deploy.py Progetto: T2BE/lfm
def run(uri, kwargs):
	# Create a temporary working directory
	tmpdir = None
	try:
		tmpdir = tempfile.mkdtemp()
		uri_type = utils.uri_type(uri)
		handler = uri_type if uri_type in ['directory', 'file'] else 'download'
		globals()['handle_{}'.format(handler)](uri, tmpdir, kwargs)
	except Exception as e:
		clip.echo('Deployment failed.', err=True)
		raise e
	else:
		clip.echo('Lambda function successfully deployed!')
	finally:
		# Clean up our temporary working directory
		if tmpdir:
			utils.delete_resource(tmpdir)
Esempio n. 2
0
def run(uri, kwargs):
    # Create a temporary working directory
    tmpdir = None
    try:
        tmpdir = tempfile.mkdtemp()
        uri_type = utils.uri_type(uri)
        handler = uri_type if uri_type in ['directory', 'file'] else 'download'
        globals()['handle_{}'.format(handler)](uri, tmpdir, kwargs)
    except Exception as e:
        clip.echo('Deployment failed.', err=True)
        raise e
    else:
        clip.echo('Lambda function successfully deployed!')
    finally:
        # Clean up our temporary working directory
        if tmpdir:
            utils.delete_resource(tmpdir)
Esempio n. 3
0
File: download.py Progetto: T2BE/lfm
def run(uri, dest):
	uri_type = utils.uri_type(uri)
	if uri_type in ['directory', 'file']:
		clip.exit('Cannot download local file, exiting...')
	return globals()['download_{}'.format(uri_type)](uri, dest)
Esempio n. 4
0
def run(uri, dest):
    uri_type = utils.uri_type(uri)
    if uri_type in ['directory', 'file']:
        clip.exit('Cannot download local file, exiting...')
    return globals()['download_{}'.format(uri_type)](uri, dest)