Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improved the Current CLI. #556

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Changelog = "https://github.com/sparckles/robyn/blob/main/CHANGELOG.md"

[tool.poetry.dependencies]
python = "^3.7"
inquirerpy = "0.3.4"
maturin = "0.14.12"
watchdog = "2.2.1"
multiprocess = "0.70.14"
Expand Down
33 changes: 19 additions & 14 deletions robyn/__main__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
import os
import webbrowser

from InquirerPy import prompt
from InquirerPy.base.control import Choice
from .argument_parser import Config


def check(value, input_name):
while value not in ["Y", "N"]:
print("Invalid input. Please enter Y or N")
value = input(f"Need {input_name}? (Y/N) ")
return value


def create_robyn_app():
project_dir = input("Enter the name of the project directory: ")
docker = input("Need Docker? (Y/N) ")

# Initailize a new Robyn project
docker = check(docker, "Docker")
questions = [
{"type": "input", "message": "Enter the name of the project directory:"},
{
"type": "list",
"message": "Need Docker? (Y/N)",
"choices": [
Choice("Y", name="Y"),
Choice("N", name="N"),
],
"default": None,
},
]
result = prompt(questions=questions)
project_dir = result[0]
docker = result[1]

print(f"Creating a new Robyn project '{project_dir}'...")

Expand Down Expand Up @@ -74,7 +78,8 @@ def index():

def docs():
print("Opening Robyn documentation... | Offline docs coming soon!")
webbrowser.open("https://sansyrox.github.io/robyn/#/")
webbrowser.open("https://sparckles.github.io/robyn/#/")



if __name__ == "__main__":
Expand Down