build/lib/lottie_animation_manager/__main__.py
def upload_current_lottie_directory():
	'''
		Main purpose of this function is to get the user to enter a valid name for the animation following s3 rules.
	'''
	global bucket
	global configured_tiny_png_key
	global compression_enabled

	# Clear screen
	click.clear()
	# Screen Title
	click.echo(click.style(emoji.emojize(' Create a New Animation :rocket: '), bg='green', fg="bright_white"))
	# Screen Instructions
	click.echo(click.style("Create your new animation by giving it a name.\n", fg="green"))
	click.echo(click.style("The animation name is the name you will use in your vue project to reference/call the animation. It's also the name given to the 'folder' inside your S3 bucket where your assets will be stored. Please name it carefully and follow typical file naming conventions.\n", fg="green"))

	# Ask for a name for their new animation
	valid = False
	while (valid == False):
		animation_name = click.prompt('Please enter a CaSE SENSitive name for your new animation (eg. animation-1)')
		if (animation_name is None or len(animation_name) < 3 or len(animation_name) > 59):
			click.echo(click.style("Please enter a valid animation name. Longer than 3 characters, shorter than 60 characters.", fg="red"))
		elif (" " in animation_name):
			click.echo(click.style("Please avoid using spaces in your animation name (best practice)", fg="red"))
		elif not re.match(r'^[a-zA-Z0-9][ A-Za-z0-9_-]*$', animation_name):
			click.echo(click.style("Please avoid using special characters.  Only alpha/numeric, dashes, and underscores are allowed.", fg="red"))
		else:
			click.echo(click.style("Now checking if '{}' already exists in your S3 Bucket...".format(animation_name), fg="blue"))

			# creating a working list of folders in the bucket
			existing_folders = []
			folders = bucket.list("","/")
			for folder in folders:
				folder_name = folder.name
				# strip the folder name to just the root level, with no trailing slashes
				folder_name = pathlib.Path(folder_name).parts[0]
				folder_name = folder_name.lower()
				existing_folders.append(folder_name)

			# check if animation name actually exists in the bucket already
			if(animation_name.lower() not in existing_folders):
				valid = True
			else:
				click.echo(click.style("Sorry, please enter another animation name. '{}' already exists in your bucket.".format(animation_name), fg="red"))

	# Clear screen
	click.clear()
	# Go to the upload current directory wizard, pass on the name they have requested
	uploadDirectory(animation_name)

		Main purpose of this function is to get the user to enter a valid name for the animation following s3 rules.
	
Main purpose of this function is to get the user to enter a valid name for the animation following s3 rules.
Main purpose of this function is to get the user to enter a valid name for the animation following s3 rules .
def upload_current_lottie_directory():
	global bucket
	global configured_tiny_png_key
	global compression_enabled
	click.clear()
	click.echo(click.style(emoji.emojize(' Create a New Animation :rocket: '), bg='green', fg="bright_white"))
	click.echo(click.style("Create your new animation by giving it a name.\n", fg="green"))
	click.echo(click.style("The animation name is the name you will use in your vue project to reference/call the animation. It's also the name given to the 'folder' inside your S3 bucket where your assets will be stored. Please name it carefully and follow typical file naming conventions.\n", fg="green"))
	valid = False
	while (valid == False):
		animation_name = click.prompt('Please enter a CaSE SENSitive name for your new animation (eg. animation-1)')
		if (animation_name is None or len(animation_name) < 3 or len(animation_name) > 59):
			click.echo(click.style("Please enter a valid animation name. Longer than 3 characters, shorter than 60 characters.", fg="red"))
		elif (" " in animation_name):
			click.echo(click.style("Please avoid using spaces in your animation name (best practice)", fg="red"))
		elif not re.match(r'^[a-zA-Z0-9][ A-Za-z0-9_-]*$', animation_name):
			click.echo(click.style("Please avoid using special characters.  Only alpha/numeric, dashes, and underscores are allowed.", fg="red"))
		else:
			click.echo(click.style("Now checking if '{}' already exists in your S3 Bucket...".format(animation_name), fg="blue"))
			existing_folders = []
			folders = bucket.list("","/")
			for folder in folders:
				folder_name = folder.name
				folder_name = pathlib.Path(folder_name).parts[0]
				folder_name = folder_name.lower()
				existing_folders.append(folder_name)
			if(animation_name.lower() not in existing_folders):
				valid = True
			else:
				click.echo(click.style("Sorry, please enter another animation name. '{}' already exists in your bucket.".format(animation_name), fg="red"))
	click.clear()
	uploadDirectory(animation_name)
def upload_current_lottie_directory ( ) : global bucket global configured_tiny_png_key global compression_enabled click . clear ( ) click . echo ( click . style ( emoji . emojize ( ' Create a New Animation :rocket: ' ) , bg = 'green' , fg = "bright_white" ) ) click . echo ( click . style ( "Create your new animation by giving it a name.\n" , fg = "green" ) ) click . echo ( click . style ( "The animation name is the name you will use in your vue project to reference/call the animation. It's also the name given to the 'folder' inside your S3 bucket where your assets will be stored. Please name it carefully and follow typical file naming conventions.\n" , fg = "green" ) ) valid = False while ( valid == False ) : animation_name = click . prompt ( 'Please enter a CaSE SENSitive name for your new animation (eg. animation-1)' ) if ( animation_name is None or len ( animation_name ) < 3 or len ( animation_name ) > 59 ) : click . echo ( click . style ( "Please enter a valid animation name. Longer than 3 characters, shorter than 60 characters." , fg = "red" ) ) elif ( " " in animation_name ) : click . echo ( click . style ( "Please avoid using spaces in your animation name (best practice)" , fg = "red" ) ) elif not re . match ( r'^[a-zA-Z0-9][ A-Za-z0-9_-]*$' , animation_name ) : click . echo ( click . style ( "Please avoid using special characters.  Only alpha/numeric, dashes, and underscores are allowed." , fg = "red" ) ) else : click . echo ( click . style ( "Now checking if '{}' already exists in your S3 Bucket..." . format ( animation_name ) , fg = "blue" ) ) existing_folders = [ ] folders = bucket . list ( "" , "/" ) for folder in folders : folder_name = folder . name folder_name = pathlib . Path ( folder_name ) . parts [ 0 ] folder_name = folder_name . lower ( ) existing_folders . append ( folder_name ) if ( animation_name . lower ( ) not in existing_folders ) : valid = True else : click . echo ( click . style ( "Sorry, please enter another animation name. '{}' already exists in your bucket." . format ( animation_name ) , fg = "red" ) ) click . clear ( ) uploadDirectory ( animation_name )
Main purpose of this function is to get the user to enter a valid name for the animation following s3 rules.
Main purpose of this function is to get the user to enter a valid name for the animation following s3 rules .
'''
		Main purpose of this function is to get the user to enter a valid name for the animation following s3 rules.
	''' # Clear screen # Screen Title # Screen Instructions # Ask for a name for their new animation # creating a working list of folders in the bucket # strip the folder name to just the root level, with no trailing slashes # check if animation name actually exists in the bucket already # Clear screen # Go to the upload current directory wizard, pass on the name they have requested