Skip to content

Commit

Permalink
Docstrings for cli interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Oct 11, 2024
1 parent 22952ec commit c0d3b09
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/scribe_data/cli/interactive.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
"""
Interactive mode functionality for the Scribe-Data CLI.
This module provides an interactive interface for users to select languages,
data types and output options for getting Wikidata data using Scribe-Data.
Interactive mode functionality for the Scribe-Data CLI to allow users to select request arguments.
.. raw:: html
<!--
Expand Down Expand Up @@ -78,6 +75,16 @@ def display_summary():


def configure_settings():
"""
Configures the settings of the interactive mode request.
Asks for:
- Languages
- Data types
- Output type
- Output directory
- Whether to overwrite
"""
# MARK: Languages

if not config.selected_languages:
Expand Down Expand Up @@ -151,7 +158,10 @@ def configure_settings():
display_summary()


def run_export():
def run_request():
"""
Runs the interactive mode request given the configuration.
"""
if not config.selected_languages or not config.selected_data_types:
rprint("[bold red]Error: Please configure languages and data types.[/bold red]")
return
Expand Down Expand Up @@ -183,6 +193,9 @@ def run_export():


def start_interactive_mode():
"""
Provides base options and forwarding to other interactive mode functionality.
"""
rprint(
f"[bold green]Welcome to {get_version_message()} interactive mode![/bold green]"
)
Expand All @@ -201,7 +214,7 @@ def start_interactive_mode():
configure_settings()

elif choice == "run":
run_export()
run_request()
rprint("[bold cyan]Thank you for using Scribe-Data![/bold cyan]")
break

Expand Down

0 comments on commit c0d3b09

Please sign in to comment.