Skip to content

Commit

Permalink
Added special character back
Browse files Browse the repository at this point in the history
  • Loading branch information
Poiuy7312 committed Sep 19, 2023
1 parent 6691550 commit b247a41
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions chasten/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Chasten checks the AST of a Python program."""
"""💫 Chasten checks the AST of a Python program."""

import sys
from pathlib import Path
Expand Down Expand Up @@ -115,15 +115,17 @@ def validate_file(
# perform the validation of the configuration file
(validated, errors) = validate.validate_configuration(yml_data_dict, json_schema)
output.console.print(
f"Validated {configuration_file_str}? {util.get_human_readable_boolean(validated)}"
f":sparkles: Validated {configuration_file_str}? {util.get_human_readable_boolean(validated)}"
)
# there was a validation error, so display the error report
if not validated:
output.console.print(f":person_shrugging: Validation errors:\n\n{errors}")
# validation worked correctly, so display the configuration file
else:
output.opt_print_log(verbose, newline="")
output.opt_print_log(verbose, label=f"Contents of {configuration_file_str}:\n")
output.opt_print_log(
verbose, label=f":sparkles: Contents of {configuration_file_str}:\n"
)
output.opt_print_log(verbose, config_file=configuration_file_yml)
return validated

Expand Down Expand Up @@ -159,7 +161,7 @@ def validate_configuration_files(
application_author=constants.chasten.Application_Author,
)
output.console.print(
"Configuration directory:"
":sparkles: Configuration directory:"
+ constants.markers.Space
+ chasten_user_config_dir_str
+ constants.markers.Newline
Expand Down Expand Up @@ -281,7 +283,7 @@ def display_serve_or_publish_details(

@cli.command()
def interact(ctx: typer.Context) -> None:
"""Interactively configure and run."""
"""🚀 Interactively configure and run."""
# construct a Trogon object; this will create a
# terminal-user interface that will allow the
# person using chasten to pick a mode and then
Expand Down Expand Up @@ -320,7 +322,7 @@ def configure( # noqa: PLR0913
),
verbose: bool = typer.Option(False, help="Display verbose debugging output"),
) -> None:
"""Manage chasten's configuration."""
"""🪂 Manage chasten's configuration."""
# output the preamble, including extra parameters specific to this function
output_preamble(
verbose,
Expand Down Expand Up @@ -363,7 +365,7 @@ def configure( # noqa: PLR0913
)
# display diagnostic information about the completed process
output.console.print(
f"Created configuration directory and file(s) in {created_directory_path}"
f":sparkles: Created configuration directory and file(s) in {created_directory_path}"
)
# cannot re-create the configuration directory, so display
# a message and suggest the use of --force the next time;
Expand Down Expand Up @@ -438,7 +440,7 @@ def analyze( # noqa: PLR0913, PLR0915
verbose: bool = typer.Option(False, help="Enable verbose mode output."),
save: bool = typer.Option(False, help="Enable saving of output file(s)."),
) -> None:
"""Analyze the AST of Python source code."""
"""💫 Analyze the AST of Python source code."""
# output the preamble, including extra parameters specific to this function
output_preamble(
verbose,
Expand Down Expand Up @@ -516,7 +518,7 @@ def analyze( # noqa: PLR0913, PLR0915
valid_directories = [input_path]
# output the list of directories subject to checking
output.console.print()
output.console.print(f"Analyzing Python source code in: {input_path}")
output.console.print(f":sparkles: Analyzing Python source code in: {input_path}")
# output the number of checks that will be performed
output.console.print()
output.console.print(f":tada: Performing {len(check_list)} check(s):")
Expand Down Expand Up @@ -662,7 +664,7 @@ def analyze( # noqa: PLR0913, PLR0915
)
# output the name of the saved file if saving successfully took place
if saved_file_name:
output.console.print(f"\nSaved the file '{saved_file_name}'")
output.console.print(f"\n:sparkles: Saved the file '{saved_file_name}'")
# confirm whether or not all of the checks passed
# and then display the appropriate diagnostic message
all_checks_passed = all(check_status_list)
Expand Down Expand Up @@ -708,7 +710,7 @@ def integrate( # noqa: PLR0913
),
verbose: bool = typer.Option(False, help="Display verbose debugging output"),
) -> None:
"""Integrate files and make a database."""
"""🚧 Integrate files and make a database."""
# output the preamble, including extra parameters specific to this function
output_preamble(
verbose,
Expand All @@ -721,7 +723,7 @@ def integrate( # noqa: PLR0913
)
# output the list of directories subject to checking
output.console.print()
output.console.print("Combining data file(s) in:")
output.console.print(":sparkles: Combining data file(s) in:")
output.console.print()
output.print_list_contents(json_path)
# extract all of the JSON dictionaries from the specified files
Expand All @@ -734,7 +736,7 @@ def integrate( # noqa: PLR0913
)
# output the name of the saved file if saving successfully took place
if combined_json_file_name:
output.console.print(f"\nSaved the file '{combined_json_file_name}'")
output.console.print(f"\n:sparkles: Saved the file '{combined_json_file_name}'")
# "flatten" (i.e., "un-nest") the now-saved combined JSON file using flatterer
# create the SQLite3 database and then configure the database for use in datasett
combined_flattened_directory = filesystem.write_flattened_csv_and_database(
Expand All @@ -745,7 +747,7 @@ def integrate( # noqa: PLR0913
# output the name of the saved file if saving successfully took place
if combined_flattened_directory:
output.console.print(
f"\nCreated this directory structure in {Path(combined_flattened_directory).parent}:"
f"\n:sparkles: Created this directory structure in {Path(combined_flattened_directory).parent}:"
)
combined_directory_tree = filesystem.create_directory_tree_visualization(
Path(combined_flattened_directory)
Expand Down Expand Up @@ -797,7 +799,7 @@ def datasette_serve( # noqa: PLR0913
),
verbose: bool = typer.Option(False, help="Display verbose debugging output"),
) -> None:
"""Start a local datasette server."""
"""🏃 Start a local datasette server."""
# output the preamble, including extra parameters specific to this function
output_preamble(
verbose,
Expand All @@ -808,7 +810,7 @@ def datasette_serve( # noqa: PLR0913
metadata=metadata,
)
# display diagnostic information about the datasette instance
label = "Starting a local datasette instance:"
label = ":sparkles: Starting a local datasette instance:"
display_serve_or_publish_details(
label, database_path, metadata, port, publish=False
)
Expand Down Expand Up @@ -866,7 +868,7 @@ def datasette_publish( # noqa: PLR0913
),
verbose: bool = typer.Option(False, help="Display verbose debugging output"),
) -> None:
"""Publish a datasette to Fly or Vercel."""
"""🌎 Publish a datasette to Fly or Vercel."""
# output the preamble, including extra parameters specific to this function
output_preamble(
verbose,
Expand All @@ -880,7 +882,7 @@ def datasette_publish( # noqa: PLR0913
f":wave: Make sure that you have previously logged into the '{datasette_platform.value}' platform"
)
# display details about the publishing step
label = f"Publishing a datasette to {datasette_platform.value}:"
label = f":sparkles: Publishing a datasette to {datasette_platform.value}:"
display_serve_or_publish_details(label, database_path, metadata, publish=True)
# publish the datasette instance using fly.io;
# this passes control to datasette and then to
Expand All @@ -895,7 +897,7 @@ def datasette_publish( # noqa: PLR0913

@cli.command()
def log() -> None:
"""Start the logging server."""
"""🦚 Start the logging server."""
# display the header
output.print_header()
# display details about the server
Expand All @@ -911,4 +913,4 @@ def log() -> None:

# ---
# End region: Command-line interface functions }}}
# ---
# ---

0 comments on commit b247a41

Please sign in to comment.